#include <bits/stdc++.h>
using namespace std;

int main(void) {
    int N;
    cin >> N;
    vector<int> C(N);
    for (int i = 0; i < N; i++) {
        char c;
        cin >> c;
        if (c == 'B') C[i] = 0;
        else if (c == 'W') C[i] = 1;
        else C[i] = 2;
    }
    vector<vector<int>> ncr = {
        {1, 0, 0},
        {1, 1, 0},
        {1, 2, 1}
    };
    int ans = 0;
    for (int i = 0; i < N; i++) {
        int r = i;
        int n = N - 1;
        int tmp = 1;
        while (n != 0) {
            int j = n % 3;
            int k = r % 3;
            n /= 3;
            r /= 3;
            tmp *= ncr[j][k];
            tmp %= 3;
        }
        ans += tmp * C[i];
        ans %= 3;
    }
    if (N % 2 == 0) ans = ans * -1;
    if (ans < 0) ans += 3;
    if (ans == 0) cout << "B" << endl;
    else if (ans == 1) cout << "W" << endl;
    else cout << "R" << endl;
}
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define vi vector<int>
#define mk make_pair
#define vll vector<long long >
#define loop(i,a,b) for(int i=a;i<=b;i++)
#define loopr(i,a,b) for(int i=b;i>=a;i--)
#define vii vector<vector<int>>
#define ll long long
void io()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}


int main()
{

	ll n;
	cin >> n;
	ll i = 1;
	ll ans = 0;
	while (i * i <= (2 * n)) {

		if ((2ll * n) % i == 0) {
			ll  no = ((2ll * n) / i ) + 1 - n;
			if (no % 2 == 0)
				ans += 2;
			no = i + 1 - n;
			if (no % 2 == 0)
				ans += 2;
			// cout << i << endl;
		}
		i++;
	}

	cout << ans << endl;

	return 0;
}
