UVa 10812: simple math operations