K = input() memo = [None]*K def e(n): if n < K: if memo[n] is None: memo[n] = 1 + sum(e(n+i+1) for i in range(6))/6. return memo[n] return 0 print e(0)