문제
Convinced that happy cows generate more milk, Farmer John has installed a giant disco ball in his barn and plans to teach his cows to dance!
Looking up popular cow dances, Farmer John decides to teach his cows the "Bovine Shuffle". The Bovine Shuffle consists of his
A shuffle is described with
Farmer John notices that some positions in his lineup contain cows in them no matter how many shuffles take place. Please help him count the number of such positions.
Problem credits: Brian Dean
입력
The first line of input contains
출력
Please output the number of positions that will always contain cows, no matter how many shuffles take place.
예제
4
3 2 1 3
3