k = gets.to_i total = 0 t = 0 [2,3,5,7,11,13].each do |x| [4,6,8,9,10,12].each do |y| t += 1 if x * y == k total += 1 end end puts t.to_f/total