#include using namespace std; int main() { int n; cin >> n; vector a(n); for (int i = 0; i < n; ++i) { cin >> a[i]; } cout << a.back() - n << endl; }