Dice and Candies

Find the expected number of throws of a fair six-sided die until the running sum reaches at least N, and print the value to six decimals.

Medium6Dynamic programmingProbabilityMathImplementationNo attempts yetTime limit2sMemory limit512 MB

Problem

Hyobin has a die with the numbers 1 through 6 written on its faces, one number per face. Each throw gives her as many candies as the number on the top face. Every face comes up with probability 16\frac{1}{6}.

Hyobin keeps throwing the die until the candies she has received add up to at least NN. Write a program that computes the expected number of throws.

Input

The first line contains an integer NN (1N1,000,0001 \le N \le 1{,}000{,}000).

Output

Print the expected number of throws on the first line, rounded to six digits after the decimal point. Always print exactly six digits after the point, padding with zeros. No NN puts the exact value on a rounding boundary.