const MOD: usize = 998244353; fn power(base: usize, times: usize) -> usize { if times == 0 { return 1usize; } if times == 1 { return base; } let temp = power(base, times/2); temp * temp % MOD * power(base, times%2) % MOD } fn comb(n: usize, r: usize) -> usize { let mut ret = 1usize; for i in 1..=r { ret *= n+1-i; ret %= MOD; ret *= power(i, MOD-2); ret %= MOD; } ret } fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let s = s.trim().chars().collect::>(); let cds = s.iter().filter(|&&c| c == 'C' || c == 'D').count(); if cds == 0 || cds == n { println!("1"); return; } println!("{}", comb(n+1-cds-1 + cds, cds)); }