mod = 998244353 n = int(input()) S = [ord(s)-ord("a") for s in input()] dp = [[0]*2 for _ in range(2)] dp[0][0] = 1 for s in S: ndp = [[0]*2 for _ in range(2)] for j0 in range(2): for k0 in range(2): for j1 in range(2): for k1 in range(2): if j0 > j1 or k0 > k1: continue if k0 < k1: if not (j0 or (j1 ^ (s == 0))): continue c = 1 else: if (j0,j1) == (0,0): c = s > 0 elif (j0,j1) == (0,1): c = max(s-1,0) else: c = 25 ndp[j1][k1] += dp[j0][k0]*c ndp[j1][k1] %= mod dp = ndp print(dp[1][1])