N = int(input()) S = input() mod = 998244353 # dp[i][j] i個目まで見て(j=0未満未確定,j=1未満確定,j=2 aが一つ未満未確定,j=3 aが一つ未満確定) dp = [[0]*(4) for i in range(N+1)] dp[0][0] = 1 a0 = ord('a') for i in range(N): ord_s = ord(S[i])-a0 if ord_s == 0: dp[i+1][2] += dp[i][0] dp[i+1][1] += dp[i][1]*25 dp[i+1][3] += dp[i][1] else: dp[i+1][0] += dp[i][0] dp[i+1][1] += dp[i][0]*(ord_s-1)+dp[i][1]*25 dp[i+1][3] += dp[i][0] + dp[i][1] + dp[i][2]*(ord_s-1)+dp[i][3]*25 dp[i+1][2] += dp[i][2] dp[i+1][0] %= mod dp[i+1][1] %= mod dp[i+1][2] %= mod dp[i+1][3] %= mod print(dp[-1][3])