#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, arr[100000], sum, x;
  cin >> n;
  sum = 0;
  for (x = 0; x < n; x++) {
    cin >> arr[x];
  }
  for (x = 0; x < n - 1; x++) {
    if (arr[x] == x + 1) {
      sum = sum + 1;
      if (arr[x + 1] == x + 2) {
        sum = sum - 1;
      }
    }
    cout << sum << endl;
  }
  if (arr[n - 1] == n) {
    sum = sum + 1;
  }
  cout << sum << endl;
  return 0;
}
