input: Write a function to count the number of pairs in a given list of numbers that sum up to a specified value x. The function should return the count of such pairs. If the list is empty, the function should return 0.
  
  def count_pairs(numbers, x):
      count = 0
      i, j = 0, len(numbers) - 1
      while i < j: 
          sum = numbers[i] + numbers[j]
          if sum == x: 
              count += 1
              i += 1
          elif sum < x: 
              i += 1 
          else: 
              j -= 1
      return count
  
  assert count_pairs([1, 2, 3, 4, 5, 6], 7) == 3
  assert count_pairs([2, 4, 6, 8, 10], 12) == 2
  assert count_pairs([1, 1, 1, 1], 2) == 3
  assert count_pairs([1, 3, 3, 3], 6) == 0
  assert count_pairs([], 5) == 0
output: def count_pairs(numbers, x):
      count = 0
      seen = set()
      for num in numbers:
          complement = x - num
          if complement in seen:
              count += 1
          seen.add(num)
      return count