require 'pp'

def gets; ARGF.gets; end

class Solver

  def initialize
  end

  def main
    n = gets.chomp.to_i

    if n.even?
      puts "0.5"
    else
      puts "#{((n / 2) + 1).to_f / n}"
    end
  end
end

if __FILE__ == $0
  Solver.new.main
end
