#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const long long int mod = 1e9 + 7;
const long long int mod1 = 998244353;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long int rand(long long int l, long long int r) {
  uniform_int_distribution<long long int> uid(l, r);
  return uid(rng);
}
const long long int N = 1e6 + 5;
string s;
long long int cnt[N], pre[N], val[N], preval[N];
void solve() {
  long long int n, x = 1e9;
  cin >> n;
  for (long long int i = 1; i <= n; i++) {
    long long int y;
    cin >> y;
    x = min(x, y);
  }
  cout << x % mod1 << '\n';
}
signed main() {
  ios ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  clock_t clk = clock();
  long long int t = 1;
  for (long long int i = 1; i <= t; i++) {
    solve();
  }
  cerr << '\n'
       << setprecision(10) << fixed << (double)(clock() - clk) / CLOCKS_PER_SEC;
  return 0;
};
