When he asks you choose number 1, you must choose a number not a letter or anything else. When he asks you choose number 2, you must choose a number not a letter or anything else. After when he ask What math? You send him one of these four: + = Add - = Subtract * = Multiply / = Divide If you wait a couple of seconds he will tell you the answer.
Very simple. It was my first math solver too. Maybe it will be useful in my games. Feel free to remix it and make anything you want with it! Soon, I will make an actual calculator. For now enjoy.