# 入力を受ける h,t,o = map(int, input().split()) t = t + o/25 o = o%25 h = h + t/4 t = t%4 h = h%10 print(int(o + t + h))