#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = mod * mod;
const long double eps = 1e-8;
const long double pi = acos(-1.0);
int main() {
  int n;
  int mi = mod;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    mi = min(mi, a);
  }
  cout << mi % 998244353 << endl;
  return 0;
}
