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