object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()

  if (n % 2 == 0) {
    println(0.5)
  } else {
    val m = n.toDouble
    println("%.9f".format(((m + 1) / 2) / m))
  }
}