L,M,N = input(),input(),input() NN = int(N)/25 if NN >= 1: M = M + NN N = N - NN*25 MM = int(M)/4 if MM >= 1: L = L + MM M = M - NN*4 LL = int(L)/4 if MM >= 1: L = L - LL*10 print L+M+N