#include<bits/stdc++.h>
using namespace std;
#define int long long
#define mid ((l + r) >> 1)
#define ls (now << 1)
#define rs ((now << 1) | 1)
#define mp make_pair

const int N = 10000005;
const int inf = 2e17 + 1;
int n, pr[N / 5], cnt, vis[N];
double s;
void init()
{
	cin >> n;
	for(int i = 2; i <= n; ++ i)
	{
		if(vis[i] == 0) pr[++ cnt] = i;
		for(int j = 1; j <= cnt && i * pr[j] <= n; ++ j)
		{
			vis[i * pr[j]] = 1;
			if(i % pr[j] == 0) break;
		}
	} 
	for(int i = 1; i <= cnt; ++ i)
		s += (double) (1) / (double) (pr[i]);
	cout << s;
}
signed main()
{
	int T = 1;
//	cin >> T;
	while(T --)
		init();
	return 0;
}


