K = 0 #1000円札の枚数 L = int(input()) #100円硬貨の枚数 M = int(input()) #25円硬貨の枚数 N = int(input()) #1円硬貨の枚数 #x 両替対象の硬貨 #y 両替後対象の硬貨/紙幣 #z1 両替前の硬貨の金額 #z2 両替後の硬貨/紙幣の金額 def Exchange(x,y,z1,z2): if (x * z1) % z2 == 0: return 0, int(y + x // (z2 / z1)) else: return int(x % (z2 / z1)), int(y + x // (z2 / z1)) if N < 25: if M >= 4: M, L = Exchange(M, L, 25, 100) if 10 <= L <= 1000: L, K = Exchange(L, K, 100, 1000) elif 25 <= N <= 1000: N, M = Exchange(N, M, 1, 25) if M >= 4: M, L = Exchange(M, L, 25, 100) if 10 <= L <= 1000: L, K = Exchange(L, K, 100, 1000) else: pass print(K + L + M + N)