#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
  const int M = 998244353;
  int n;
  cin >> n;
  int a = 1 << 30;
  for (int i = 0; i < n; i++) {
    int b;
    cin >> b;
    a = min(a, b);
  }
  cout << a % M << endl;
}
