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