<?php
$n = trim(fgets(STDIN));
$p = explode(" ",trim(fgets(STDIN)));

$i = 1;
while($i <= $n){
    $a[$i] = $i - $p[$i - 1];
    ++$i;
}

$ans = 0;
$i = 1;
foreach($a as $val){
    if($val == 0){
        ($i == 0)?:++$ans;
    }
    $i = $val;
}

echo $ans;