#!/usr/bin/env python # -*- coding: utf-8 -*- k = int(input()) m = [0] + [pow(7.0 / 6, i - 1) for i in range(1, 8)] append = m.append for i in range(8, k + 1): append((m[i - 6] + m[i - 5] + m[i - 4] + m[i - 3] + m[i - 2] + m[i - 1]) / 6.0 + 1) print(m[k])