#include <iostream>
using namespace std;

int main()
{
	//receive input
	int testCase; cin >> testCase;
	int* arr = new int[testCase];
	for (int i = 0; i < testCase; i++)
	{
		cin >> arr[i];
	}

	//find the max value among those inputs.
	int max = 0;
	for (int i = 0; i < testCase; i++)
	{
		if (arr[i] > max)
		{
			max = arr[i];
		}
	}

	//find the N
	int temp = 2;
	bool canEscape = false;
	while (true)
	{
		for (int i = 0; i < testCase; i++)
		{
			if (temp % arr[i] != 0)
			{
				break;
			}
			else if (i == testCase-1 && temp > max) //if examined with all numbers && N != temp
			{
				cout << temp;
				canEscape = true; //to escape while loop.
			}
		}
		if (canEscape)
			break;
		temp++;
	}

	delete []arr;
	return 0;
}