#include <bits/stdc++.h>
using namespace std;
// #include <atcoder/all>
// using namespace atcoder
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<long long>;
using vvl = vector<vector<long long>>;
#define rep(i, s, n) for (int i = (int)s; i < (int)n; i++)
#define repr(i, n, s) for (int i = (int)n; (int)s < i; i--)
#define len(a) (int)a.size()
#define all(a) a.begin(), a.end()
/* 1次元ベクトルをスペースでつなぎ、改行をつけて出力 vi, vl, list<int>, list<ll>に対応  */
template<class T> void print_elements(T a) {string str = ""; for (auto itr = a.begin(); itr != a.end(); ++itr) \
        {str += to_string(*itr) + ' ';} str.pop_back(); cout << str << endl;}

const int INF32 = 1 << 29;
const long long INF64 = 1LL << 60;
const long long MOD = 1000000009;
const double PI = acos(-1);


int main() {
    int N;
    cin >> N;

    double ans = 0.0;

    rep(k, 1, N) {
        ans += 1.0 * N / (N - k);
    }
    cout <<fixed << setprecision(11) <<  ans << endl;
}

#include<bits/stdc++.h>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;
typedef long long int lli;
typedef vector<int> vi;
typedef vector<long long int> vlli;
typedef pair<int,int> pii;
typedef pair<long long int,long long int> plli;
typedef vector< vi > vvi ;
typedef vector< vlli > vvlli  ;
#define fi(i,a,b) for(int i=a;i<=b;i++)
#define flli(i,a,b) for(long long int i=a;i<=b;i++)
#define bi(i,a,b) for(int i=a;i>=b;i--)
#define blli(i,a,b) for(long long int i=a;i>=b;i--)
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define all(x) x.begin(),x.end()
#define sz(x) x.size()
#define pi 2*acos(0.0)
#define pb push_back
#define tr(v,it) for(decltype(v.begin()) it=v.begin();it!=v.end();it++)
#define present(v,num) (v.find(num)!=v.end())
#define cpresent(v,num) (find(v.begin(),v.end(),num)!=v.end())
#define pq priority_queue
#define mp make_pair
const int inf=INT_MAX;
const lli INF =LLONG_MAX;
const lli mod = 1e9+7;
int main() {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fast;
    string s;cin>>s;
    deque<char> a;
    bool flag=true;
    lli n=sz(s);
    flli(i,0,n-1)
    {
    	if(s[i]=='R')
    	{
    		flag=flag^true;
    	}
    	else
    	{
    		if(flag)
    		{
    			if(a.empty())
    			{
    				a.push_back(s[i]);
    				continue;
    			}
    			auto vari=a.rbegin();
    			if(*vari!=s[i])
    				a.push_back(s[i]);
    			else a.pop_back();
    		}
    		else 
    		{
    			if(a.empty())
    			{
    				a.push_front(s[i]);
    				continue;
    			}
    			auto vari=a.begin();
    			if(*vari!=s[i])
    				a.push_front(s[i]);
    			else a.pop_front();
    		}
    	}
    }
    string t;
    while(!a.empty())
    {
    	auto vari=a.begin();
    	t.pb(*vari);
    	a.pop_front();
    }
    if(!flag)reverse(all(t));
    tr(t,it)cout<<*it;
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
    return 0;
}