#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <string>
#include <cmath>
#include <queue>
#include <tuple>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <random>
#include <set>
#include <stack>
#include <time.h>
#include <unordered_map>
#include <unordered_set>

//#include <bits/stdc++.h>
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i,i0,n) for(int (i)=(i0);(i)<(n);(i)++)
#define FORR(i,i0,n) for(int (i)=(n)-1; (i)>=(i0);(i)--)
#define SORT(x) sort(x.begin(),x.end())
#define SORTR(x) sort(x.begin(),x.end(),greater<int>())

#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple

using namespace std;
using ll = long long;
using LL = long long;

typedef std::pair<int, int> pii;
typedef std::pair<int, double> pid;
typedef std::vector<int> vi;
typedef std::vector<pii> vii;

const double PI = 3.14159265358979323846264338327950L;
const int mod = 1e9+7;
const ll INF = 1LL<<60;

struct container {
    int bottom, top, id;
    container(int id, int bottom, int top) : top(top), bottom(bottom), id(id) {
    }
};


struct Edge {
    ll to, from, cost;
    Edge(ll to, ll from, ll cost) :to(to), from(from), cost(cost) {}
    Edge(): to(-1), from(-1), cost(0){}
};

struct Data {
    ll cost,val;
    Data(ll cost=0, ll val=0) : cost(cost), val(val){}
    bool operator<(const Data& a) const {
        return cost > a.cost;
    }
};


vector<int> to[200200];

struct edge{
    int a,b,c;
    edge(int a = -1,int b = -1, int c = -1):a(a),b(b),c(c){}
    bool operator<(const edge& a) const {
        return c > a.c;
    }
};


void solve(){
    int n;
    cin >> n;
    
    double ans = 0.0;
    
    rep(i,n-1){
        double N = i+1;
        double M = n-N;
        double f = M/N;
        double f1 = N*(N+M)/(M*M);
        ans += f*f1;
    }
    
    cout << std::setprecision(15) << ans;
    
    
//     int N = 3;
//     int M = 11;
//     double c = 0;
//     rep(i,10000){
//         double j = i+1;
//         double m = 1;
//         rep(jj,j){
//             m *= double (N)/M;
            
//         }
//         c += j*m;
//     }
//     cout << c << endl;
    
//     cout << 1.*M*N/c;
}


int main() {
    int T = 1;
    // cin >> T;
    
    while (T--) {
        solve();
        cout << endl;
    }
}












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

double ans;
int main() {
	int n;
	cin >> n;
	for (int i = 1; i < n; ++i) {
		ans += (double)n / (n - i);
	}
	printf("%.6lf", ans);
	return 0;
}