calculates output of a number of operations inserted as a string