{"raw_statement":[{"iden":"problem statement","content":"We have $N$ gemstones labeled $1$ through $N$.\nYou can perform the following operation any number of times (possibly zero).\n\n*   Select a positive integer $x$, and smash all the gems labeled with multiples of $x$.\n\nThen, for each $i$, if the gem labeled $i$ remains without getting smashed, you will receive $a_i$ yen (the currency of Japan). However, $a_i$ may be negative, in which case you will be charged money.\nBy optimally performing the operation, how much yen can you earn?"},{"iden":"constraints","content":"*   All input values are integers.\n*   $1 \\leq N \\leq 100$\n*   $|a_i| \\leq 10^9$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$a_1$ $a_2$ $...$ $a_N$"},{"iden":"sample input 1","content":"6\n1 2 -6 4 5 3"},{"iden":"sample output 1","content":"12\n\nIt is optimal to smash Gem $3$ and $6$."},{"iden":"sample input 2","content":"6\n100 -100 -100 -100 100 -100"},{"iden":"sample output 2","content":"200"},{"iden":"sample input 3","content":"5\n-1 -2 -3 -4 -5"},{"iden":"sample output 3","content":"0\n\nIt is optimal to smash all the gems."},{"iden":"sample input 4","content":"2\n-1000 100000"},{"iden":"sample output 4","content":"99000"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}