407254: GYM102726 F Zoom Exercises
Description
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++).
InputThe 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})$$$.
OutputOutput the number of pushups that Elijah will have to do after playing all the games.
ExamplesInput1 6Output
0Input
2 30 2Output
4Note
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.