문제
Bessie and Elsie are playing a game with () piles of stones, where the -th pile has stones for each (). The two cows alternate turns, with Bessie going first.
First, Bessie chooses some positive integer and removes stones from some pile with at least stones. Then Elsie chooses some positive integer such that divides and removes stones from some pile with at least stones. Then Bessie chooses some positive integer such that divides and removes stones from some pile with at least stones and so on. In general, , the number of stones removed on turn , must divide .
The first cow who is unable to remove stones on her turn loses.
Compute the number of ways Bessie can remove stones on her first turn in order to guarantee a win (meaning that there exists a strategy such that Bessie wins regardless of what choices Elsie makes). Two ways of removing stones are considered to be different if they remove a different number of stones or they remove stones from different piles.
입력
The first line contains .
The second line contains space-separated integers .
출력
Print the number of ways Bessie can remove stones on her first turn in order to guarantee a win.
Note that the large size of integers involved in this problem may require the use of 64-bit integer data types (e.g., a "long long" in C/C++).
예제 입력 1
1
7
예제 출력 1
4
예제 입력 2
6
3 2 3 2 3 1
예제 출력 2
8
점수
Test cases 3-5 satisfy .Test cases 6-10 satisfy .Test cases 11-20 satisfy no additional constraints.
코드를 제출하려면 로그인이 필요합니다.
로그인