L = int(input()) M = int(input()) N = int(input()) to = L * 100 + M * 25 + N while to > 0: if to > 0 and to < 1000: to = to break else : to = to - 1000 L = to // 100 to = to - (L * 100) M = to // 25 to = to - (M * 25) N = to print(N + M +L)