#include <bits/stdc++.h>
using namespace std;
template <typename T>
void _dbg(const char* _s, T _h) {
  cerr << _s << " = " << _h << "\n";
}
template <typename T, typename... Ts>
void _dbg(const char* _s, T _h, Ts... _t) {
  int _b = 0;
  while (((_b += *_s == '(') -= *_s == ')') != 0 || *_s != ',') cerr << *_s++;
  cerr << " = " << _h << ",";
  _dbg(_s + 1, _t...);
}
using ll = long long;
const ll INF = static_cast<ll>(1e9) + 7ll;
const ll LINF = INF * INF;
const int MAXN = static_cast<int>(2e6) + 17;
int n;
ll a[MAXN];
bool read() {
  if (!(cin >> n)) return false;
  for (ll i = 0; i < (ll)(n); ++i) cin >> a[i];
  return true;
}
void solve() { cout << *min_element(a, a + n) % 998244353 << '\n'; }
int main() {
  cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  while (read()) solve();
  return 0;
}
