#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
ostream& operator<<(ostream& output, const pair<A, B>& p) {
  output << "(" << p.first << ", " << p.second << ")";
  return output;
}
template <class A>
ostream& operator<<(ostream& output, const vector<A>& a) {
  output << "[";
  for (auto it = a.begin(); it != a.end(); ++it) {
    if (it != a.begin()) {
      output << ", ";
    }
    output << *it;
  }
  output << "]";
  return output;
}
using lld = long long;
using pii = pair<int, int>;
using pll = pair<lld, lld>;
const int mxN = 3003;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  lld ans = 0;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    ans = a - 1;
  }
  cout << ans << endl;
  return 0;
}
