import java.util.*


fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val a = scanner.nextInt()
    if (a % 2 == 0) return println(0.5)
    val aa = (a.toDouble()/2) + 0.5
    println((aa/a.toDouble()))
}