func_code_string: #include <bits/stdc++.h>   using namespace std;   int p[2048];   vector<int> s[2048];   int main() {     int n;     int a;     cin >> n;     for (int i = 1; i <= n; i++) {       cin >> a;       p[i] = a;       s[a].push_back(i);     }     int res = 0;     bool fl = true;     int k = 1;     while (fl) {       fl = false;       for (int i = 1; i <= n; i++) {         if (p[i] == -k) {           p[i] = 0;           for (int j = 0; j < s[i].size(); j++) p[s[i][j]] = -k - 1;           fl = true;         }       }       if (fl) res++;       k++;     }     cout << res << endl;   }   