#include #include #include #include using namespace std; using i32 = int32_t; using u32 = uint32_t; using i64 = int64_t; using u64 = uint64_t; #define rep(i,n) for(int i=0; i<(n); i++) int main(){ int N; cin >> N; string S; cin >> S; i64 dp[2][2] = {}; // [is same][used 'a'] dp[1][0] = 1; for (char c : S) { i64 ci = c - 'a'; i64 nxdp[2][2] = {}; nxdp[0][0] += dp[0][0] * 25; nxdp[0][1] += dp[0][1] * 25; nxdp[0][1] += dp[0][0]; if (ci == 0) { nxdp[1][1] += dp[1][0]; } else { nxdp[1][0] += dp[1][0]; nxdp[1][1] += dp[1][1]; nxdp[0][0] += dp[1][0] * (ci - 1); nxdp[0][1] += dp[1][1] * (ci - 1); nxdp[0][1] += dp[1][0]; } rep(s, 2) rep(t, 2) dp[s][t] = nxdp[s][t] % 998244353; } cout << dp[0][1] << endl; return 0; } struct ios_do_not_sync { ios_do_not_sync() { ios::sync_with_stdio(false); cin.tie(nullptr); } } ios_do_not_sync_instance;