# class Node:
#     def __init__(self,key):
#         self.data = key
#         self.left = None
#         self.right = None

def height(root):
    if root == None:
        return 0
    else:
        lheight = height(root.left)
        rheight = height(root.right)
        if lheight > rheight:
            return lheight + 1
        else:
            return rheight + 1

# root = Node(5)
# root.left = Node(2)
# root.right = Node(8)
# root.left.left = Node(4)
# root.left.right = Node(9)
# root.right.left = Node(3)
# root.right.right = Node(7)

# print(height(root))
