import sys
import decimal # 10進法に変換，正確な計算

def input():
    return sys.stdin.readline().strip()

def main():
    n = int(input())
    n = decimal.Decimal(n)
    if n % 2 == 0:
        print(1/decimal.Decimal(2))
        return
    
    print(((n-1)/2+1)/n)

    
    
main() import sys sys import decimal decimal def input():
    return sys.stdin.readline().strip() input return sys.stdin.readline().strip() sys.stdin.readline().strip() sys.stdin.readline().strip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline strip def main():
    n = int(input())
    n = decimal.Decimal(n)
    if n % 2 == 0:
        print(1/decimal.Decimal(2))
        return
    
    print(((n-1)/2+1)/n)

    
     main n = int(input()) n int(input()) int input() input n = decimal.Decimal(n) n decimal.Decimal(n) decimal.Decimal decimal Decimal n if n % 2 == 0:
        print(1/decimal.Decimal(2))
        return
    
     n % 2 == 0 n % 2 n 2 0 print(1/decimal.Decimal(2)) print 1/decimal.Decimal(2) 1 decimal.Decimal(2) decimal.Decimal decimal Decimal 2 return print(((n-1)/2+1)/n) print ((n-1)/2+1)/n (n-1)/2+1 (n-1)/2 n-1 n 1 2 1 n main() main def main():
    n = int(input())
    n = decimal.Decimal(n)
    if n % 2 == 0:
        print(1/decimal.Decimal(2))
        return
    
    print(((n-1)/2+1)/n)

    
     def main():
    n = int(input())
    n = decimal.Decimal(n)
    if n % 2 == 0:
        print(1/decimal.Decimal(2))
        return
    
    print(((n-1)/2+1)/n)

    
     main def input():
    return sys.stdin.readline().strip() def input():
    return sys.stdin.readline().strip() input
import sys
import decimal # 10進法に変換，正確な計算

def input():
    return sys.stdin.readline().strip()

def main():
    n = int(input())
    n = decimal.Decimal(n)
    if n % 2 == 0:
        print(1/decimal.Decimal(2))
        return
    
    print(((n-1)/2+1)/n)

    
    
main()