Learn how to use structural pattern matching (the match statement) to work recursively through tree-like structures.
The only way to learn mathematics is to do mathematics.