#coding:utf-8 L_c = input()#100yen M_c = input()#25yen N_c = input()#1yen c1 = N_coin % 25#1yen c1_25 = N_coin // 25#1->25yen c25 = (M_coin + c1_25) % 4#25yen c25_100 = (M_coin + c1_25) // 4#25->100yen c100 = (L_coin + c25_100) % 10#100yen print c1 + c25 + c100