#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int n;
int ans;
int a[100005];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    ans = max(ans, a[i]);
  }
  printf("%d\n", ans % mod);
}
