import strutils, math const n = 3 t = [10, 4, 25] var LMN: array[n , int] for i in countup(0, n - 1): LMN[i] = stdin.readLine.parseInt for i in countdown(n - 1, 0): if i != 0: LMN[i - 1] += LMN[i] div t[i] LMN[i] = LMN[i] mod t[i] echo LMN.sum