L=int(input())
M=int(input())
N=int(input())

NM=0
ML=0

if N >= 25:
    NM=N//25
    N%=25

if M+NM >= 4:
    ML=(M+NM)//4
    M=(M+NM)%4

if L+ML >= 10:
    #K=(L+ML)//10
    L=(L+ML)%10

print(L+M+N)