lsm = [] for i in range(3): lsm.append(int(input())) if 0<=lsm[0]<=1000 and 0<=lsm[1]<=1000 and 0<=lsm[2]<=1000: N = lsm[2]%25 lsm[1] = (lsm[1]+(lsm[2]//25)) M = lsm[1]%4 lsm[2] = (lsm[0]+(lsm[1]//4)) L = lsm[2]%10 print(L+M+N) else: print('error')