I analyzed the pattern. You have to first identify element using xpath.
Now, get text from that element and split string with space " ".
String splitStr = text.split(" ");
Now your splitStr will be your first number/number in word format
splitStr will be arithmetic operator (+,-,*,/)
splitStr will be another number/number in word format.
Now from above you can easily find out the calculation and do sendKeys into result text box.
Hope it helps.