import random K=int(input()) ANS=0 for i in range(10**6): A=0 S=0 while S!=K: S+=random.randint(1,6) A+=1 if S>K: S=0 ANS+=A print(ANS/(10**6))