#include <bits/stdc++.h>
#define rep(i, n)	for(int i=0;i<(int)(n);i++)
#define ALL(a)	(a).begin(),(a).end()
using namespace std;
using ll=long long;
typedef pair<int,int> P;

int main(){
    int n;
    string s;
    cin>>n>>s;
    while(s.size()>1){
        while(n%3!=1){
            int k=1;
            string next;
            rep(i,s.size()-k){
                if((s[i]=='B'&&s[i+k]=='B')||(s[i]=='R'&&s[i+k]=='W')||(s[i]=='W'&&s[i+k]=='R')){
                    next+='B';
                }
                else if((s[i]=='R'&&s[i+k]=='R')||(s[i]=='B'&&s[i+k]=='W')||(s[i]=='W'&&s[i+k]=='B')){
                    next+='R';                
                }else{
                    next+='W';
                }
            }
            s.erase();
            s=next;
            n=s.size();
            //cout<<s<<endl;
        }
        if(s.size()==1) break;
        while(n%3==1){
            int k=3;
            string next;
            for(int i=0;i<n;i+=3){
                next+=s[i];
            }
            s.erase();
            s=next;
            n=s.size();
            //cout<<s<<endl;
        }
    }
    cout<<s<<endl;
}
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define PI acos(-1)
#define vi vector<int>
const int kMod = 998244353;
const int kInf = (~(1<<31)) / 2 - 500;
const ll kInfL = (~(1LL<<63)) / 2 - 2000;

int main() {
  ll B, C;
  cin >> B >> C;
  pair<ll, ll> plus = {B, B}, minus = {-B, -B};
  // plus
  plus.second = min(plus.second, B - C / 2);
  plus.first = max(plus.first, B + (C - 2) / 2);
  minus.second = min(minus.second, -B - (C - 1) / 2);
  minus.first = max(minus.first, -B + (C - 1) / 2);
  ll ans = 0;
  if (plus.second <= minus.first) {
    ans = max(plus.first, minus.first) - min(plus.second, minus.second) + 1;
  } else {
    ans += plus.first - plus.second + 1;
    ans += minus.first - minus.second + 1;
  }
  cout << ans << endl;
}
