## https://yukicoder.me/problems/no/1740 MOD = 998244353 def main(): N = int(input()) S = input() answer = 0 has_one_a = False for i in range(N - 1): s = S[i] if s >= "b": if not has_one_a: answer += pow(25, N - 1 - i, MOD) answer %= MOD if s >= "c": v = ord(s) - 1 - ord("a") if not has_one_a: ans = ((N - 1 - i) * pow(25, N - 2 - i, MOD)) % MOD answer += (v * ans) % MOD answer %= MOD else: answer += (v * pow(25, N - 1 - i, MOD)) % MOD answer %= MOD if s == "a": if not has_one_a: has_one_a = True else: print(answer) return # 最後の一つについて s = ord(S[-1]) - ord("a") for t in range(s): if t == 0 and not has_one_a: answer += 1 answer %= MOD if t > 0 and has_one_a: answer += 1 answer %= MOD print(answer) if __name__ == "__main__": main()