Hint #1
Take note that there are three distinct hats.  Each hat represents a number.
Hint #2
There’s more than just addition here.
Hint #3
Each of the top hats in the first equation must represent the number ‘8’.
Answer
22

First top hat (the brim bent up) = 8
Second top hat (the more white one) = 10
Third top hat (the brim bent down) = 4