L = int(input()) M = int(input()) N = int(input()) # 1 yen n = N // 25 N -= n*25 M = M + n # 25 yen m = M // 4 M = M - m*4 L = L + m l = L // 10 L = L - l*10 print(L+M+N)