#include using namespace std; typedef long long ll; const ll MOD = 998244353; ll dp[4]; int main() { int n; string s; cin >> n >> s; dp[0] = 1; for(int i = 0; i < n; i++){ ll d[4]; if(s[i] == 'a'){ d[0] = 0; d[1] = dp[0]; d[2] = dp[2] * 25 % MOD; d[3] = dp[3] * 25 % MOD; } else{ d[0] = dp[0]; d[1] = dp[1]; d[2] = (dp[0] * (s[i] - 'b') + dp[2] * 25) % MOD; d[3] = (dp[0] + dp[1] * (s[i] - 'b') + dp[2] + dp[3] * 25) % MOD; } swap(dp, d); } cout << (dp[3]) % MOD << endl; }