#include <bits/stdc++.h>
using namespace std;
int main(){
    long long l,ans=1;cin>>l;l--;
    int d[5][2]{{2,8},{3,4},{5,2},{7,1},{11,1}};
    for(long long i=0;i<11;i++){
        ans*=l-i;
        for(int j=0;j<5;j++){
            while(ans%d[j][0]==0&&d[j][1]>0){
                ans/=d[j][0];
                d[j][1]--;
            }
        }
    }
    cout << ans << endl;
}

#include<bits/stdc++.h>
using namespace std;
//#define int long long
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define endl '\n'
#define vec vector<ll>
#define mat vector<vector<ll> >
#define fi first
#define se second
#define double long double
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
//typedef long double ld;
typedef complex<double> Complex;
const ll INF=1e9+7;
const ll MOD=INF;
const ll inf=INF*INF;
const ll mod=MOD;
const ll MAX=100010;



signed main(){
    string s;cin>>s;
    string a="",b="";
    rep(i,s.size()){
        if(s[i]=='R')swap(a,b);
        else{
            if(a.size()>0&&a[a.size()-1]==s[i])a.pop_back();
            else a+=s[i];
        }
    }
    ll n=a.size(),m=b.size();
    reverse(all(a));
    reverse(all(b));
    rep(i,min(n,m)){
        if(a[n-i-1]==b[m-i-1]){
            a.pop_back();
            b.pop_back();
        }else{
            break;
        }
    }
    reverse(all(a));
    cout<<b<<a<<endl;
}