#include <iostream> using namespace std; const int MAXN =1000000; int F[MAXN]; int main() { int n; cin >>n; int i = 0,p = 0, c = 0; while (___(1)___) { if(F[i] == 0 ) { if(___(2)___) { F[i] = 1; ___(3)___; } ___(4)___; } ___(5)___; } int ans = -1; for (i =0 ; i < n; i++) if (F[i] == 0) ans = i; cout << ans << endl; return 0; }