```
def depth(root):
if root == None:
return 0
return max(depth(root.left), depth(root.right)) + 1
class Solution:
# @param root, a tree node
# @return an integer
def maxDepth(self, root):
return depth(root)
```

Really simple way of solving the question, through recursion.