from typing import List, Tuple, Callable, TypeVar import sys import itertools import heapq import bisect import math from collections import deque, defaultdict, Counter from functools import lru_cache, cmp_to_key input = sys.stdin.readline if __file__ != 'prog.py': sys.setrecursionlimit(10 ** 6) def readints(): return map(int, input().split()) def readlist(): return list(readints()) def readstr(): return input()[:-1] K = int(input()) @lru_cache(None) def solve(n): if n == K: return (0, 0) if n > K: return (1, 0) Sa = 0 Sb = 0 for i in range(1, 6 + 1): a, b = solve(n + i) Sa += a Sb += b return (Sa / 6, Sb / 6 + 1) a, b = solve(0) print(b / (1 - a))