import math l = int(input()) #100円硬貨の枚数 m = int(input()) #25円硬貨の枚数 n = int(input()) #1円硬貨の枚数 change_n = math.floor((n * 1) / 25) result_n = n-((change_n * 25)/1) m = m + change_n change_m = math.floor((m * 25) / 100) result_m = m-((change_m * 100)/25) l = l + change_m change_l = math.floor((l * 100) / 1000) result_l = l-((change_l * 1000)/100) result = result_n + result_m + result_l print (result)