import java.util.Scanner;
//http://poj.org/problem?id=3276
//从边界开始考虑+前缀和优化利用奇偶性
public class Main {
public static int[] face;
public static int MAX_LENGTH = 5005;
static {
face = new int[MAX_LENGTH];
}
public static void memset(int[] arr){
for(int i= 0 ; i < arr.length ; i++){
arr[i] = 0;
}
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int[] f = new int[MAX_LENGTH];
while(in.hasNext()){
memset(face);
int n = in.nextInt();
in.nextLine();
for(int i = 0 ; i < n; i ++){
char fb = in.nextLine().charAt(0);
if(fb == 'B'){
face[i] = 1;
}
}
int ansM = n;
int ansK = 1;
for(int i = 1 ; i <= n ; i++){
int mm = 0;
memset(f);
boolean flag = true;
for(int j = 0 ; j < n ;j ++){
if(j > 0){
f[j]+=f[j-1];
}
int tmp = f[j];
if(j - i >= 0){
tmp -= f[j-i];
}
if((face[j] +tmp)%2 == 1){
if(j+i>n){
flag =false ;
break;
}
f[j]++;
mm++;
}
}
if(mm < ansM && flag){
ansM = mm;
ansK =i;
}
}
System.out.println(ansK + " "+ ansM);
}
}
}
11-11