import sys #input = sys.stdin.readline #input = sys.stdin.buffer.readline def main(): n = int(input()); MOD = 998244353 s = str(input()) #dp[i][j][k]:i文字目まで見て、j=0(余裕)/1(ちょうど一致)k=0(未使用)1(a一回), dp = [[0]*2 for _ in range(2)] dp[1][0] = 1 for i in range(n): p = [[0]*2 for _ in range(2)] p,dp = dp,p if s[i] != 'a': miman = ord(s[i]) - ord('a') #必ず1以上 dp[0][0] = p[0][0]*25 + p[1][0]*(miman - 1) dp[0][1] = p[0][0]*1 + p[0][1]*25 + p[1][0] + p[1][1]*(miman - 1) dp[1][0] = p[1][0] dp[1][1] = p[1][1] else: dp[0][0] = p[0][0]*25 dp[0][1] = p[0][0]*1 + p[0][1]*25 dp[1][0] = 0 dp[1][1] = p[1][0] #MOD取る for j in range(2): for k in range(2): dp[j][k] %= MOD #print(dp) ans = dp[0][1] print(ans%MOD) if __name__ == '__main__': main()