N = int(input()) A = list(map(int,input().split())) ans = sum(A) * pow(N,-1,998244353) ans %= 998244353 print(ans)