#include <bits/stdc++.h>
using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);  
	
	vector<double> dp(27);
	int k;
	cin >> k;
	for(int i = 25; i >= 0; i--) {
		if(i >= k) dp[i] = 0;
		else {
			for(int j = i + 1; j <= i + 6; j++) {
				dp[i] += dp[j] / 6;
			}
			dp[i]++;
		}
	}
	cout << setprecision(5) << fixed << dp[0] << endl;
	return 0;
}