import sys input = sys.stdin.readline from collections import * N = int(input()) S = input()[:-1] dp = [[[0]*2 for _ in range(2)] for _ in range(N+1)] dp[0][0][0] = 1 MOD = 998244353 for i in range(N): d = ord(S[i])-ord('a') for j in range(2): for k in range(2): for c in range(26 if j else d+1): if k==1 and c==0: continue nj = j|(c