import sys read=sys.stdin.buffer.read readline=sys.stdin.buffer.readline hrd_yen,tf_yen,one_yen=map(int,read().split()) cvrt=one_yen//25 one_yen-=25*cvrt tf_yen+=cvrt cvrt=tf_yen//4 tf_yen-=4*cvrt hrd_yen+=cvrt thsd_bill_cnt=hrd_yen//10 hrd_yen-=thsd_bill_cnt*10 print(one_yen+tf_yen+hrd_yen)