A row of n meshed cogwheels drives a conveyor. Cog i has t_i teeth. Every cog starts with a painted tooth at the top. After each tooth-step, every cog advances by exactly one tooth. All the painted teeth return to the top simultaneously for the first time after a number of steps equal to the least common multiple of the tooth counts. Print that number of steps.
Input format
Line 1: an integer n, the number of cogs.
Line 2: n space-separated integers, the tooth counts t_1 ... t_n.
Output format
A single integer: the least common multiple of the n tooth counts.
Constraints
- 1 <= n <= 40
- 1 <= t_i <= 30
- The answer fits in a signed 64-bit integer.