#!usr/bin/env python3 from collections import defaultdict, deque from heapq import heappush, heappop from itertools import permutations, accumulate import sys import math import bisect def LI(): return [int(x) for x in sys.stdin.readline().split()] def I(): return int(sys.stdin.readline()) def IR(n): return [I() for _ in range(n)] def LIR(n): return [LI() for _ in range(n)] sys.setrecursionlimit(1000000) mod = 998244353 def main(): n = I() s = list(map(lambda x:ord(x)-ord("a"),input())) dp = [[0]*2 for _ in range(2)] dp[0][0] = 1 for i in s: ndp = [[0]*2 for _ in range(2)] for j in range(2): x = 26 if j else i+1 for k in range(2): dpjk = dp[j][k] if not dpjk: continue for l in range(x): nk = k+(l==0) if nk > 1: continue nj = j|(l= mod: ndp[nj][nk] -= mod dp = ndp print(dp[1][1]) return if __name__ == "__main__": main()