func_code_string: #include <bits/stdc++.h>   using namespace std;   void solve(int a[], int n) {     int cnt = 0, pos = 0;     while (pos < n) {       cnt++;       int mx = pos;       while (pos < n && pos <= mx) {         mx = max(mx, a[pos]);         pos++;       }     }     cout << cnt << endl;   }   int main() {     int n;     cin >> n;     int a[n];     for (int i = 0; i < n; i++) {       cin >> a[i];       a[i]--;     }     solve(a, n);     return 0;   }   