#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
void qread(int &x) {
  int neg = 1;
  x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') neg = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = 10 * x + c - '0', c = getchar();
  x *= neg;
}
const int maxn = 100005;
const int mod = 998244353;
int n, ans = 1e9 + 5;
int a[maxn];
int main() {
  scanf("%d", &n);
  for (int(i) = 0; (i) < n; i++) {
    scanf("%d", &a[i]);
    ans = min(ans, a[i]);
  }
  printf("%d\n", ans % mod);
  return 0;
}
