k=gets.to_i pd = [2,3,5,7,11,13] sd = [4,6,8,9,10,12] pt = [pd.select{|p|k%p==0}, sd.select{|s|k%s==0}] vs = pt[0].map{|x|pt[1].map{|y|x*y}}.flatten p = vs.include?(k) ? pt.map{|r|r.size}.min : 0 puts p/(6*6).to_f