L = int(input()) M = int(input()) N = int(input()) ans = 0 M += int(N // 25) ans += N % 25 L += int(M // 4) ans += M % 4 ans += L % 10 print(ans)