L = int(input()) M = int(input()) N = int(input()) M1,n = divmod(N,25) L1,m = divmod(M+M1,4) S,l = divmod(L+L1,10) print(l+m+n)