#include using namespace std; constexpr int mod = 998244353; long long dp[200001][4]; int main() { int N; string S; cin >> N >> S; dp[0][0] = 1; for(int i = 0; i < N; i++) { for(int j = 0; j < 4; j++) { for(int k = 0; k < 26; k++) { if(k == 0) { if(j == 0 || j == 2) { if(j == 0 && S[i] == 'a') { dp[i+1][1] += dp[i][j]; dp[i+1][1] %= mod; } else { dp[i+1][j|3] += dp[i][j]; dp[i+1][j|3] %= mod; } } } else { if(j >= 2) { dp[i+1][j] += dp[i][j]; dp[i+1][j] %= mod; } else if(S[i]-'a' == k) { dp[i+1][j] += dp[i][j]; dp[i+1][j] %= mod; } else if(S[i]-'a' > k) { dp[i+1][j|2] += dp[i][j]; dp[i+1][j|2] %= mod; } } } } } cout << dp[N][3] << endl; }