#include<bits/stdc++.h> using namespace std; int t,n; int main() { cin>>t; for(int i=0;i<t;i++) { cin>>n; } cout<<max(0,n-2); return 0; }