#include<iostream>
#include<map>
#include<vector>
#include<set>
using namespace std;
typedef long long li;
#define rep(i,n) for(int i=0;i<(n);i++)
#define df 0
template<class T> void print(const T& t){ cout << t << "\n"; }
template<class T, class... Ts> void print(const T& t, const Ts&... ts) { cout << t; if (sizeof...(ts)) cout << " "; print(ts...); }

// map 型
template<class S,class T>
std::ostream& operator<<(std::ostream& os, const map<S,T>& mp){
  for(const pair<S,T>& x: mp){
    cout << "[" << x.first << "]=" << x.second << " ";
  }
  return os;
}

// Container コンテナ型, map以外
template< template<class ...> class Ctn,class T>
std::ostream& operator<<(std::ostream& os,const Ctn<T>& v){
  auto itr=v.begin();
  while(itr!=v.end()){
    if(itr!=v.begin())cout << " ";
    cout << *(itr++);
  }
  return os;
};

int gcd(int a,int b){return (b==0)?a:gcd(b,a%b); }

int main(){
  int n,m; cin >>n >>m;
  map<int,int> mp;
  auto  add=
    [&](int a){
      for(int i=1;i*i<=a and i<=m; i++){
        if(a%i) continue;
        mp[i]=gcd(a,mp[i]);
        if(a/i<=m)mp[a/i]=gcd(a,mp[a/i]);
      }
      if(df)print(a,":",mp);
    };
  
  add(m);
  
  rep(i,n-1){
    int a; cin >>a;
    if(a<m) m=a;
    add(a);
  }
  int cnt=0;
  for(auto p:mp){
    if(p.first>m) break;
    if(p.first==p.second) cnt++;
  }
  print(cnt);
}

// Problem: C - Tricolor Pyramid
// Contest: AtCoder - AtCoder Regular Contest 117
// URL: https://atcoder.jp/contests/arc117/tasks/arc117_c
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
#define pb push_back
#define sz(a) int(a.size())
using namespace std;
typedef long long ll;

int read() {
	char ch=getchar();int x=0,f=1;
	while(ch<'0'||ch>'9') {if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9') {x=x*10+ch-'0';ch=getchar();}
	return x*f;
}

const int N=4e5+5;

char a[N];
int n;

pair<int,int> p(ll x) {
	if(x==0) return make_pair(0,0);
	int res=0;
	for(;x%3==0;) {
		x/=3,res++;
	}
	return make_pair(res,x);
}

int main() {
	n=read();
	scanf("%s",a+1);
	ll ans=0;
	ll f=0,g=1;
	for(int i=1;i<=n;i++) {
		int x;
		if(a[i]=='W') x=0;
		if(a[i]=='R') x=1;
		if(a[i]=='B') x=2;
		if(!f) ans=(ans+g*x%3)%3;
		pair<int,int> u=p(n-1-i+1),d=p(i);
		f+=u.first-d.first,g=g*u.second%3*d.second%3;
	}
	if(n%2==0) ans=(3-ans)%3;
	if(ans==0) printf("W\n");
	if(ans==1) printf("R\n");
	if(ans==2) printf("B\n");
	return 0;
}
