L = int(input()) M = int(input()) N = int(input()) S = (100 * L) + (25 * M) + N #入金合計 K = S % 1000 #千円札に両替できない金額 l = K / 100 #100円硬貨の枚数 m = (K % 100) / 25 #25円硬貨の枚数 n = (K % 100) % 25 #1円硬貨の枚数 print(int(l + m + n))