L,M,N=map(int,input().split()) M = M + (N/25) N = N % 25 L = L + (M/4) M = M % 4 L = L % 10 print(M + N + L)