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

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define TO_STRING(VariableName) # VariableName
#define LOG(x) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<endl;
#define LOG2(x,y) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<endl;
#define LOG3(x,y,z) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
#define LOG4(w,x,y,z) if(DEBUG)cout<<TO_STRING(w)<<"="<<w<<" "<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;

template<class T>bool chmax(T & a, const T & b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }

void func(std::string S){

    deque<char> T;
    lli rev = 0;

    for(auto &c:S){
        if(c == 'R'){
            rev++;
        }
        else{
            if(rev % 2 == 0){
                T.push_back(c);
                if(T.size()>=2){
                    if(T[T.size()-1]==T[T.size()-2]){
                        T.pop_back();
                        T.pop_back();
                    }
                }
            }
            else{
                T.push_front(c);
                if(T.size()>=2){
                    if(T[0]==T[1]){
                        T.pop_front();
                        T.pop_front();
                    }
                }
            }
        }
    }

    string s;
    REP(i,0,T.size()){
        if(rev%2==0)s.push_back(T[i]);
        else s.push_back(T[T.size()-1-i]);
    }
    cout<<s<<endl;


}

int main(){
    // cout << fixed << setprecision(5);

    std::string S;
    std::cin >> S;
    func(S);
    return 0;
}

#include<bits/stdc++.h>
//#include <atcoder/all>

#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define ALL(a)  (a).begin(),(a).end()
#define pb push_back
#define fi first
#define se second
#define sz(x) ((int)x.size())
 
using namespace std;
//using namespace atcoder;
using ld = long double;
using ll = long long;
using P = pair<ll, ll>;
 
template<typename T> bool chmin(T& a, const T& b) { if(a > b){ a = b; return 1;} return 0; }
template<typename T> bool chmax(T& a, const T& b) { if(a < b){ a = b; return 1;} return 0; }

const ll ZER = 0;
const ll MOD = 998244353;
const ll INF = 1e9;



int main(){
    int n;
    cin >> n;
    double res = 0;
    REP(i, 1, n - 1){
      res += (double)1.0 / (double)i;
    }
    cout << fixed << setprecision(10) << (double) n * res<< endl;
}