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()) dp = [0] * (K + 10) for i in range(K)[::-1]: dp[i] = sum(dp[i + 1:i + 6 + 1]) / 6 + 1 print(dp[0])