L = int(input()) M = int(input()) N = int(input()) nq, nr = divmod(N, 25) M = M + nq mq, mr = divmod(M, 4) L = L + mq lq, lr = divmod(L, 10) print(nr+mr+lr)