#include<bits/stdc++.h>
using namespace std;

int main(){
  int n;
  cin >> n;
  int count = 0;
  int after,point;
  for(int i=1;i<=n;i++){
    cin >> point;
    if(point==i){
      count++;
      if(i<n){
	cin >> point;
	i++;
      }
    }
  }
  cout << count << endl;
  return 0;
}
