input: Write a Python function to count the number of nodes in a linked list.
  assert count_nodes(LinkedList()) == 0
  ll = LinkedList()
  ll.add(1)
  ll.add(2)
  ll.add(3)
  assert count_nodes(ll) == 3
  ll.remove()
  assert count_nodes(ll) == 2
output: class Node:
      def __init__(self, value=None):
          self.value = value
          self.next = None
  
  class LinkedList:
      def __init__(self):
          self.head = None
  
      def add(self, value):
          new_node = Node(value)
          new_node.next = self.head
          self.head = new_node
  
      def remove(self):
          if self.head is not None:
              self.head = self.head.next
  
  def count_nodes(ll):
      count = 0
      current = ll.head
      while current:
          count += 1
          current = current.next
      return count