L = int(input()) #100円の枚数 M = int(input()) #25円の枚数 N = int(input()) #1円の枚数 sum = 100*L + 25*M + N remaind_1000 = divmod(sum, 1000) remaind_100 = divmod(remaind_1000[1], 100) remaind_25 = divmod(remaind_100[1], 25) remaind_1 = remaind_25[1] coin = remaind_100[0] + remaind_25[0] + remaind_1 print(coin)