Set the number of segments