407254: GYM102726 F Zoom Exercises

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

F. Zoom Exercisestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Elijah and Fiona are trying to improve their fitness this quarantine season and have decided to set up daily zoom workout sessions in order to motivate each other. Their workout routine has gone great for the past couple weeks with the exception of the pushup sets. Elijah hates pushups so he devises this game to try to offload as much of the pushups as he can onto Fiona. They usually do $$$n$$$ different rounds of pushups in a given workout session. For each round, they decide to play the following game: the number of pushups in the $$$i$$$th round is $$$a_i$$$ and the players take turns replacing the number with any of its divisors other than itself. The person that replaces the number with a $$$1$$$ loses. Fiona agrees to play the game with Elijah on the condition that if she wins the $$$i$$$th round, Elijah must do double the amount of pushups ($$$2 \cdot a_i$$$) allotted for that round and if he wins, he doesn't have to do any pushup that round. Given that both players play the game optimally, calculate the number of pushups that Elijah will have to do after all the rounds.

Elijah and Fiona have become fitness buffs so the number of pushups per round can be quite large, be sure to use the appropriately sized type (like longs in Java and C++).

Input

The first line contains the number of pushup amounts $$$n$$$ $$$(1 \leq n \leq 100)$$$.

Then, $$$n$$$ lines will follow, the $$$i$$$th line will contain a single integer $$$a_i$$$ $$$(2 \leq a_i \leq 10^{11})$$$.

Output

Output the number of pushups that Elijah will have to do after playing all the games.

ExamplesInput
1
6
Output
0
Input
2
30
2
Output
4
Note

For the first sample, Elijah can replace the $$$6$$$ with $$$3$$$, and then Fiona is forced to replace $$$3$$$ with a $$$1$$$ so Elijah will win and will not have to do any push-ups.

加入题单

算法标签: