# No.32 貯金箱の憂鬱https://yukicoder.me/problems/no/32 # 14:40まで #あまりは1円硬貨のみ普通に求めて、残りは両替後の数値をつかう L = int(input()) M = int(input()) N = int(input()) NM = N // 25 ML = (M + NM) // 4 LS = (L + ML) % 10 MN = N % 25 LM = (M + NM) % 4 coin = [LS, MN, LM] print(sum(coin))