input: Write a python function to calculate the numbers where both the 0th and nth bits are set.
  assert count_bits(2) == 1
  assert count_bits(3) == 2
  assert count_bits(1) == 1
output: def count_bits(n):
      count = 0
      for i in range(n + 1):
          if (i & 1) and (i & (1 << n)):
              count += 1
      return count