#include using namespace std; int main(){ std::ios::sync_with_stdio(false); int n; while(cin >> n){ vector arr(n); vector looped(n,false); for (int i = 0; i < n; i++) { cin >> arr[i]; arr[i]--; } int ans = 0; for(int i=0;i