n = int(input()) s = input() dp = [[[0 for _ in range(2)] for __ in range(2)] for ___ in range(n+1)] dp[0][0][0] = 1 mod = 998244353 for i in range(n): dp[i+1][1][1] += 25 * dp[i][1][1] dp[i+1][0][1] += 25 * dp[i][0][1] dp[i+1][1][1] += dp[i][0][1] now = -ord("a") + ord(s[i]) for j in range(now): if j == 0: dp[i+1][1][1] += dp[i][0][0] else: dp[i+1][0][1] += dp[i][0][0] dp[i+1][1][1] += dp[i][1][0] if now == 0: dp[i+1][1][0] += dp[i][0][0] else: dp[i+1][0][0] += dp[i][0][0] dp[i+1][1][0] += dp[i][1][0] dp[i+1][0][0] %= mod dp[i+1][0][1] %= mod dp[i+1][1][0] %= mod dp[i+1][1][1] %= mod # print(dp) print(dp[n][1][1])