#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 1e9;
int main() {
  int n;
  cin >> n;
  int p[n];
  for (int i = 0; i < n; i++) {
    cin >> p[i];
  }
  int ans = 0;
  for (int i = 0; i < n; i += 2) {
    if (p[i] == i + 1) ans++;
  }
  cout << ans << endl;
}
