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