L = int(input()) M = int(input()) N = int(input()) money = 100 * L + 25 * M + N money = money % 1000 coin100 = money // 100 coin25 = (money % 100) // 25 coin1 = money % 25 print(coin100 + coin25 + coin1)