#include "bits/stdc++.h" using namespace std; #define repi(i,a,b) for(int i=(a), i##_len=(b); ibool maxi(T &a, const T &b) { if (abool mini(T &a, const T &b) { if (b>n>>m; rep(i,n){ cin>>in; if(in=='A')ctr[0]++; else ctr[1]++; } rep(i,m){ cin>>in; if(in=='A')ctr[2]++; else ctr[3]++; } co(min(ctr[0],ctr[2])+min(ctr[1],ctr[3])); }