public class Main{ public static void main(String[] Args) throws Exception{ int ch; int a=0; int b=0; while((ch=System.in.read())!='0'){ if((char)ch=='A') a++; if((char)ch=='B') b++; } System.in.read(); System.out.println(a==b...