#include <bits/stdc++.h>
using namespace std;
int const M = 998244353;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  cout << *min_element(a.begin(), a.end()) % M << endl;
}
