package no038; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int kr = sc.nextInt(); int kb = sc.nextInt(); char[] s = sc.next().toCharArray(); int n = 30; int nr = 10, nb = 10; int ans = 0; for(int i=0;i<1<>r&1) == 0) { sb.append(s[k]); } r++; }else if (s[k] == 'B') { if ((j>>b&1) == 0) { sb.append(s[k]); } b++; }else if(s[k] == 'W') { sb.append(s[k]); } } String t = sb.toString(); if (isValidString(t, kr, kb)) { ans = Math.max(ans,t.length()); } } } System.out.println(ans); } public static boolean isValidString(String t,int kr,int kb) { char[] s = t.toCharArray(); int n = s.length; for(int i=0;i