#貯金箱の憂鬱 L = int(input()) M = int(input()) N = int(input()) M += int(N / 25) N %= 25 L += int(M / 4) M %= 4 L %= 10 print(L + M + N)