L = int(raw_input()) M = int(raw_input()) N = int(raw_input()) n = N % 25 m = (N / 25 + M) % 4 l = ((N / 25 + M) / 4 + L) % 10 print n+m+l