l = gets.to_i m = get.to_i s = gets.to_i while s >= 25 do s=s-25 m=m+1 end while m >= 4 do m=m-4 l=l+1 end while l >= 10 do l=l-10 end puts s+m+l