#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef pair<string,string> Pstring;
typedef pair<double,double> Pdouble;


#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define Precision13 cout << fixed << setprecision(13)
const double PI=3.14159265358979323846;
const int MAX = 510000;
const int MOD = 1000000007;
const int INF = 1<<29;
using Graph = vector<vector<int>>;


int main(){
  ll n;
  cin >> n;

  ll i = 1;

  ll sum = 0;
  while(true){
    sum += i;

    if(sum>=n){
      cout << i <<endl;
      return 0;
    }

    i++;
  }

}

#include<cstdio>
#include<cmath>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
using namespace std;
#define MAXN 500005
#define lowbit(x) (x&-x)
#define reg register
typedef long long LL;
typedef unsigned long long uLL;
typedef unsigned int uint;
typedef pair<int,int> pii;
const int INF=0x7f7f7f7f;
const int mo=998244353;
const double PI=acos(-1.0);
template<typename _T>
_T Fabs(_T x){return x<0?-x:x;}
template<typename _T>
void read(_T &x){
	_T f=1;x=0;char s=getchar();
	while(s>'9'||s<'0'){if(s=='-')f=-1;s=getchar();}
	while('0'<=s&&s<='9'){x=(x<<3)+(x<<1)+(s^48);s=getchar();}
	x*=f;
}
char str[MAXN],ans[MAXN<<2],sta[MAXN];int n,head,tail,stak;
signed main(){
	scanf("%s",str+1);n=(int)strlen(str+1);head=tail=2*n;
	for(int i=1;i<=n;i++){
		if(str[i]=='R'){
			if(head!=tail){
				swap(head,tail);
				if(head<tail)head++,tail++;
				else head--,tail--;
			}
		}
		else{
			if(head<=tail)ans[tail]=str[i],tail++;
			else ans[tail]=str[i],tail--;
		}
		//printf("%d %d:%c\n",head,tail,ans[i]);
		//if(head<tail)for(int i=head;i<tail;i++)putchar(ans[i]);
		//else for(int i=head;i>tail;i--)putchar(ans[i]);puts("");
	}
	if(head<tail)
		for(int i=head;i<tail;i++)
			if(sta[stak]==ans[i])stak--;
			else sta[++stak]=ans[i];
	else
		for(int i=head;i>tail;i--)
			if(sta[stak]==ans[i])stak--;
			else sta[++stak]=ans[i];
	for(int i=1;i<=stak;i++)putchar(sta[i]);
	return 0;
}
