solve 1005: simple math