Boxes
Andrii's class went on a field trip to a box factory, where they learned about the process of making boxes from different materials. They were particularly intrigued by the elegant pthaline boxes, which are shaped like rectangular parallelepipeds with square bases. The cost of each box, with a base side of length ( a ), is ( a ) monetary units (m.u.). As a souvenir, each student was allowed to take one box, and inside that box, they could fit several smaller identical boxes, and inside those, even smaller ones, and so on. (The thickness of the walls can be ignored, so for example, a box with a side of 10 can contain 25 boxes with a side of 2). What is the maximum value in m.u. that could be obtained as a souvenir if ( N ) different integer sizes of boxes were used: ( a_1, a_2, ..., a_N ).
Input
The program reads the number ( N ) (1 () ( N ) () 100) and ( N ) different sizes ( a_1, a_2, ..., a_N ) (1 () ( a_i ) () ( 10^6 )). All numbers are provided in one line, separated by spaces.
Output
The maximum value of the souvenir.