#include <bits/stdc++.h>
using namespace std;
int main() {
  int cnt = 0;
  int c, t;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i += 2) {
    cin >> c >> t;
    if (i == c || i + 1 == t) {
      cnt++;
    }
  }
  if (n % 2) {
    cin >> c;
    if (n == c) {
      cnt++;
    }
  }
  cout << cnt << endl;
}
