#include #include using ll = long long; #define MOD 1000000007 #define Mod 998244353 const int MAX = 1000000005; const long long INF = 1000000000000000005LL; using namespace std; using namespace atcoder; map dp; long double rec(int n) { if (dp.count(n)) return dp[n]; if (n == 1) return 0; long double s = 0; for (int m = 2; m*m <= n; m++) { if (n % m == 0) s += rec(m); } return dp[n] = (long double)n/(n - 1) + s/(n - 1); } int main() { ios::sync_with_stdio(0);cin.tie(); int N; cin >> N; cout << fixed << setprecision(12) << rec(N) << endl; }