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