input: def count_pairs(numbers, x):
      """ Count the number of pairs in a sorted list of numbers that sum up to a given number x.
      >>> count_pairs([1, 2, 3, 4, 5, 6], 5)
      2
      >>> count_pairs([1, 2, 3, 4, 5, 6], 10)
      0
      >>> count_pairs([1, 3, 4, 5, 6, 8, 9], 10)
      2
      """
output:     count = 0
      left, right = 0, len(numbers) - 1
      while left < right:
          if numbers[left] + numbers[right] == x:
              count += 1
              left += 1
              right -= 1
          elif numbers[left] + numbers[right] < x:
              left += 1
          else:
              right -= 1
      return count