#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int i[10000];
  int c, n, j, tmp, n1, n2;
  int s;
  cin >> s;
  n = 0;
  c = 0;
  do {
    if (n + 1 == i[n]) {
      n1 = n;
      j = n + 1;
      do {
        if (j + 1 == i[j]) {
          n2 = j;
          tmp = i[n1];
          i[n1] = i[n2];
          i[n2] = tmp;
          c++;
        }
        j++;
      } while (j < s);
      n++;
    }
    n++;
  } while (n < s);
  cout << c << endl;
  return 0;
}
