#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;

int main()
{
    int N;
    cin >> N;

    string S;
    cin >> S;
    int sum = 0;

    vector<int> a(N);

    for (int i = 0; i < N; i++)
    {
        if (S[i] == 'R')
            a[i] = 0;
        if (S[i] == 'G')
            a[i] = 1;
        if (S[i] == 'B')
            a[i] = 2;
    }

    vector<int> cnt(3);
    for (int i = 0; i < N; i++)
    {
        cnt[a[i]]++;
    }

    long long ans = 1;
    for (int i = 0; i < 3; i++)
    {
        ans *= cnt[i];
        cout << cnt[i] << endl;
    }

    for (int i = 0; i < N; i++)
    {
        for (int j = i + 1; j < N; j++)
        {
            int k = j + (j - i);
            if (k < N)
            {
                if (a[i] == a[j])
                    continue;
                if (a[i] == a[k])
                    continue;
                if (a[k] == a[j])
                    continue;
                ans--;
            }
        }
    }

    cout << ans << endl;

    return 0;
}