import sys from decimal import Decimal, ROUND_HALF_UP primes = [2, 3, 5, 7, 11, 13] composites = {4, 6, 8, 9, 10, 12} K = int(sys.stdin.readline()) if K == 0: print("0.00000000000000000") else: count = 0 for p in primes: if K % p != 0: continue c = K // p if c in composites: count += 1 if count == 0: print("0.00000000000000000") else: prob = Decimal(count) / Decimal(36) prob_rounded = prob.quantize(Decimal('0.00000000000000000'), rounding=ROUND_HALF_UP) print(prob_rounded)