input: Write a python function to count the number of prime numbers in a given range.
  assert count_primes(10, 20) == 4
  assert count_primes(1, 10) == 4
  assert count_primes(30, 50) == 5
output: def count_primes(start, end):
      def is_prime(n):
          if n <= 1:
              return False
          if n <= 3:
              return True
          if n % 2 == 0 or n % 3 == 0:
              return False
          i = 5
          while i * i <= n:
              if n % i == 0 or n % (i + 2) == 0:
                  return False
              i += 6
          return True
  
      count = 0
      for number in range(start, end + 1):
          if is_prime(number):
              count += 1
      return count