Yeongwoo is a frog. Ribbit, ribbit, ribbit.
Yeongwoo stands on a stone bridge built from n stones in a row. The stones are numbered 1, 2, and so on up to n from the left, and each stone has one number written on it. If the number on stone i is Ai, Yeongwoo can jump from stone i to stone i−Ai, which is Ai places to the left, or to stone i+Ai, which is Ai places to the right. He cannot leave the bridge, so a jump whose destination number is smaller than 1 or larger than n is not available.
A stone is visitable if Yeongwoo can land on it after some number of jumps from the starting stone. The starting stone also counts as visitable.
Given the starting stone, find how many stones Yeongwoo can visit.