# of occurrences of an element in a sorted array