#include <bits/stdc++.h>   using namespace std;   const int MAXN = 1e5 + 5;   int main() {     int n;     cin >> n;     string s;     cin >> s;     queue<int> D, R;     for (int i = 0; i < n; i++) {       if (s[i] ==  D ) D.push(i);       if (s[i] ==  R ) R.push(i);     }     while (D.size() && R.size()) {       if (D.front() < R.front()) {         R.pop();         D.push(D.front() + n);         D.pop();       } else {         D.pop();         R.push(R.front() + n);         R.pop();       }     }     cout << (D.size() ?  D  :  R ) << endl;     return 0;   }   