#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 1 << 30, a;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a;
    ans = (ans < a ? ans : a);
  }
  cout << ans % 998244353 << endl;
}
