#include using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) #define INF ((1LL<<62)-(1LL<<31)) #define all(a) (a).begin(),(a).end() #define rall(a) (a).rbegin(),(a).rend() typedef long long ll; typedef pair pl; const ll mod=998244353; ll modpow(ll n,ll r) { ll num=1; while(r) { if(r&1) num=num*n%mod; n=n*n%mod; r/=2; } return num; } ll comb(ll n,ll r) { ll x=1,y=1; for(ll i=0;i> n >> s; map mp; for(char c:s) mp[c]++; ll m=mp['A']+mp['B'],k=mp['C']+mp['D']; cout << comb(m+k,k) << endl; return 0; }