L = int(input()) M = int(input()) N = int(input()) AN = N//25 AM = (AN+M)//4 BN = N%25 BM = (AN+M)%4 BL = (AM+L)%10 print(BN+BM+BL)