#include using namespace std; const long long MOD = 998244353; int main(){ int N; cin >> N; string S; cin >> S; vector>> dp(N + 1, vector>(2, vector(2, 0))); dp[0][0][0] = 1; for (int i = 0; i < N; i++){ for (int j = 0; j < 2; j++){ for (int k = 0; k < 2; k++){ for (int l = 0; l < 26; l++){ if (j == 0 && l > S[i] - 'a'){ continue; } if (k == 1 && l == 0){ continue; } int j2 = j; if (l < S[i] - 'a'){ j2 = 1; } int k2 = k; if (l == 0){ k2++; } dp[i + 1][j2][k2] += dp[i][j][k]; dp[i + 1][j2][k2] %= MOD; } } } } cout << dp[N][1][1] << endl; }