#include<stdio.h>
#include<stdlib.h>

/*int max(int aa,int bb){
  if(aa>bb){
    return aa;
  }else{
    return bb;
  }
  int min(int aaa,int bbb){
    if(aaa<bbb){
      return aaa;
    }else{
      return bbb;
    }
  }
*/
int main(void){
  int n,r1[4001],g1[4001],b1[4001],d,a,i,j,b,aa,bb,aaa,bbb,x,p,q,r,max,min,e,f;
  char s[4001];
  scanf("%d",&n);
  scanf("%s",s);
  p=0;
  q=0;
  r=0;
  d=0;
  for(i=0;i<n+1;i++){
    b1[i]=0;
  }
  for(i=0;i<n;i++){
    if(s[i]=='R'){
      r1[p]=i;
      p=p+1;
    }
    else if(s[i]=='G'){
      g1[q]=i;
      q=q+1;
    }else{
      b1[i]=1;
      r=r+1;
    }
  }
  /*int max(int aa,int bb){
    if(aa>bb){
      return aa;
    }else{
      return bb;
    }
  int min(int aaa,int bbb){
    if(aaa<bbb){
      return aaa;
    }else{
      return bbb;
    }
    }*/
  for(i=0;i<p;i++){
    for(j=0;j<q;j++){
      a=abs(r1[i]-g1[j]);
      if(r1[i]-g1[j]>0){
      max=r1[i];
      min=g1[j];
      }else{
	max=g1[j];
	min=r1[i];
      }
      if(b1[max+a]==1){
	  d=d+1;
	}
      if(b1[min-a]==1){
	e=e+1;
      }
      if(a%2==0&&b1[min+a/2]==1){
	f=f+1;
      }
    }
  }
  printf("%d %d %d\n",d,e,f);
      x=p*q*r-d-e-f;
      printf("%d\n",x);
      return 0;
}
