#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n;
const int mod = 998244353;
int main() {
  std::ios::sync_with_stdio(false), std::cin.tie(0);
  cin >> n;
  vector<int> a(n);
  for (auto &e : a) cin >> e;
  cout << *min_element(begin(a), end(a)) % mod << endl;
  return 0;
}
