William has baked a cornmeal pudding pone! They have invited all their friends over to share the dessert. However, they need your help to divide it evenly among all friends.
William wants all of their friends to have an equal number of slices. However, they don't know how many friends will actually show up. Friends show up in groups (where the total number of groups is $$$N$$$), and William cuts the pone in the following manner:
The pone starts off unsliced. William wants to know – after everyone (all $$$N$$$ friend groups) show up, what's the minimum number of slices the cake will be cut into that satisfies the given technique?
See the notes for a more detailed example.
The first line contains an integer $$$N$$$ ($$$1 \le N \le 10$$$), the number of friend groups.
The next line contains $$$N$$$ integers $$$a_1,...,a_N$$$ ($$$1 \le a_i \le 10$$$), representing the number of friends in each friend group.
Output a single integer, the minimum number of slices the cake will be cut into.
3 2 3 10
30
The example proceeds in the following manner:
It can be shown that this is the least number of slices possible that satisfies the requirements.