Count Occurance of a given number in sorted array