You are playing hopscotch on a one-indexed array of integers. You can choose to start at some index (which is undecided). Your goal is to reach index . This game of hopscotch is strange. At index , it is already defined where you must hop to. At index , you must hop to index .
You want to find out, for how many starting indices will you be able to reach index ?
The first line will contain the integer , the number of elements.
The second line will contain integers, .
Output the number of starting indices where you will be able to reach index .
For 3/15 of the points, .
For an additional 4/15 of the points, .
6 5 2 2 2 3 1
Explanation For Sample
You will be able to reach index when starting at indices or .