#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,srt,end) for(ll i = (srt); i < (ll)(end); i++)
ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;
//cout << std::fixed << std::setprecision(15) << y << endl;

// For debug
// Ref: https://qiita.com/ysuzuki19/items/d89057d65284ba1a16ac
#define dump(var)  do{std::cerr << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cerr << e << "\n";}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cerr << e << " "; } std::cerr << "\n";}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ std::cerr << "\n"; for(const auto& v : vv){ view(v); } }
template<typename T> void dump_cout(const T& v) { for(long long i = 0; i < v.size(); i++) std::cout << v[i] << (i == v.size()-1 ? "\n" : " "); }

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n;
    cin >> n;
    
    double ans;
    double cnt = double(n);
    rep(i,0,n){
        ans += (1 / ( cnt / double(n) ));
        cnt -= 1.0;
    }
    // eliminate probability of choosing initial position
    ans -= 1.0;
    printf("%.11f\n", ans);
    return 0;
}
// Problem: D - Staircase Sequences
// Contest: AtCoder - AtCoder Beginner Contest 190
// URL: https://atcoder.jp/contests/abc190/tasks/abc190_d
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include<bits/stdc++.h>
using namespace std;
#define int long long int 
#define deb(x) cout<< #x <<" is "<<x<<endl;

vector<int>f;
void factorize(int n){
	for(int i=1;i*i<=n;i++){
	  if(n % i == 0){
	  f.emplace_back(i);
    if(i != n/i)f.emplace_back(n/i);
    }
	}
}



bool check(int n,int C){
  return ( C % n && (n-1)%2 );
}

void solve(){
  int n;
  cin>>n;
  factorize(2 * n);
  int cnt = 0;
  // cout<<f.size()<<endl;
  for(int i=0;i<f.size();i++){
    // deb(f[i])
    if(check(f[i] , n))cnt++;
    // else cout<<f[i]<<endl;
  }
  cout<<cnt * 2<<endl;
  	
}

signed main(){
	solve();
}