input: Write a function to count the number of pairs in a list that sum up to a given number x. If the list is empty or has fewer than 2 elements, return 0.
  assert count_pairs([1, 8, 3, 7, 6, 5, 4, 9], 10) == 3
  assert count_pairs([1, 8, 3, 7, 6, 5, 4, 9], 15) == 1
  assert count_pairs([1, 8, 3, 7, 6, 5, 4, 9], 20) == 0
  assert count_pairs([], 10) == 0
  assert count_pairs([1], 10) == 0
output: def count_pairs(lst, x):
      if len(lst) < 2:
          return 0
      count = 0
      seen = set()
      for num in lst:
          if x - num in seen:
              count += 1
          seen.add(num)
      return count