#include using namespace std; int main() { int n; cin >> n; vector a(n); for(auto &x : a) cin >> x; cout << a[n - 1] - n; }