Stone Game

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Bessie and Elsie are playing a game with NN (1N1051\le N\le 10^5) piles of stones, where the ii-th pile has a_ia\_i stones for each 1iN1\le i\le N (1a_i1061\le a\_i\le 10^6). The two cows alternate turns, with Bessie going first.

  • First, Bessie chooses some positive integer s_1s\_1 and removes s_1s\_1 stones from some pile with at least s_1s\_1 stones.
  • Then Elsie chooses some positive integer s_2s\_2 such that s_1s\_1 divides s_2s\_2 and removes s_2s\_2 stones from some pile with at least s_2s\_2 stones.
  • Then Bessie chooses some positive integer s_3s\_3 such that s_2s\_2 divides s_3s\_3 and removes s_3s\_3 stones from some pile with at least s_3s\_3 stones and so on.
  • In general, s_is\_i, the number of stones removed on turn ii, must divide s_i+1s\_{i+1}.

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 NN.

The second line contains NN space-separated integers a_1,,a_Na\_1,\ldots,a\_N.

출력

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++).