Boxes#7373

Boxes

1 second
64 megabytes
Medium

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 phthaline boxes, which are shaped like rectangular parallelepipeds with square bases. The cost of each box, with a base side of length , is 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 can contain boxes with a side of ).

What is the maximum value in m.u. that could be obtained as a souvenir if different integer sizes of boxes were used: a_1, a_2, \ldots, a_N?

Input

The program reads the number (1 \le N \le 100) and different sizes a_1, a_2, \ldots, a_N (1 \le a_i \le 10^6). All numbers are given in one line and are separated by spaces.

Output

The maximum value of the souvenir.

Examples

Example 1

Loading
Loading