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

#L = 100円  M = 25円  N = 1円

M = M + N // 25
N = N % 25

L += M * 25 // 100
M = M * 25 % 100 // 25

L = L % 10
print(L+M+N)