r=gets.split(" ").map!(&:to_i) g=r.min r.map!{|e|e-g}.sort!; loop{ if r[1]==0 break if r[2]/5<=0 g+=r[2]/5 r[2]=r[2]-r[2]/5*4 elsif r[1]*3