Hey, I'd put your total collected gems into an array and save/load your values using the Local Storage object. Each section (addition, subtraction etc.) can have it's own x location in your array (assuming you don't want to store multiple values for each section, in which case you could use a 3 dimensional array).
When you want to display the values, you just set (or append) your text to the x (or x/y) location containing the value you saved.
I hope this is helpful, but if I've misunderstood please let me know.