l,m,n=[int(input())for _ in[0]*3] m+=n//25 print((l+m//4)%10+m%4+n%25)