You are given an array A with elements 0 to n-1, numbers can be repeated in the array. Create n sets where

S[i]={a[i],a[a[i]],a[a[a[i]]]…}. Set has all elements unique. Find the size of the largest set.

Input:

First line contains n, size of the array. n<1000

Next lines contains n numbers, each element of the array

Output

Prints one number: Size of the largest set.

Sample Test Case:

Input: {3,1,2,0}

Output: 2

Explanation:

Four possible sets are

{3,0},{1},{2}{0,3}