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}.size, sd.select{|s|k%s==0}.size].min puts pt/(6*6).to_f