#include <bits/stdc++.h>
using namespace std;
int const md = 998244353, inf = 1e9;
int main() {
  int n;
  scanf("%d", &n);
  int mn = inf;
  for (int i = 0; i < (int)(n); ++i) {
    int t;
    scanf("%d", &t);
    mn = min(mn, t);
  }
  printf("%d\n", mn % md);
}
