#include<bits/stdc++.h>
using namespace std;
void f(int,int,int,int);
int h,w,a,b,ans;
int mp[20][20];
int main(void)
{
	scanf("%d %d %d %d",&h,&w,&a,&b);
	f(0,0,a,b);
	printf("%d\n",ans);
	return 0;
}
void f(int y,int x,int aa,int bb)
{
/*	for(int i=0;i<w;i++){
		for(int j=0;j<h;j++){
			printf(".%d.",mp[i][j]);
		}
		printf("\n");
	}*/
	if(aa==0&&bb==0) ans++;
	else {
		if(x==w){
			// printf("x=%d y=%d\n",x,y);
			x=0;
			y++;
		}
		if(x<w&&y<h){
			if(mp[y][x]==1) f(y,x+1,aa,bb);
			else {
				if(bb>0&&mp[y][x]==0){
					mp[y][x]=1;
					f(y,x+1,aa,bb-1);
					mp[y][x]=0;
				}
				if(aa>0&&x+1<w&&mp[y][x]==0&&mp[y][x+1]==0){
					mp[y][x]=1;
					mp[y][x+1]=1;
					f(y,x+1,aa-1,bb);
					mp[y][x]=0;
					mp[y][x+1]=0;
				}
				if(aa>0&&y+1<h&&mp[y][x]==0&&mp[y+1][x]==0){
					mp[y][x]=1;
					mp[y+1][x]=1;
					f(y,x+1,aa-1,bb);
					mp[y][x]=0;
					mp[y+1][x]=0;
				}
			}
		}
	}
}
#include <iostream>
#include <vector>
#include <set>
#include <bitset>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <list>
#include <cmath>
#include <algorithm>
#include <cassert>

using namespace std;

template <typename input_type>
input_type input() {
    input_type inp;
    cin >> inp;

    return inp;
}

const int max_sz = 5e1, max_nm = 5e1 + 5;
long long inf = 5e18;

bool come[max_nm];
int sz, arr[max_sz];
long long mn_ans = inf;
vector <int> prime;

long long gcd(long long a, long long b) {
   if (b == 0) {
       return a;
   }

   return gcd(b, a % b);
}

bool check(long long ans) {
    for (int i = 0; i < sz; i++) {
        if (gcd(arr[i], ans) == 1) {
            return false;
        }
    }

    return true;
}

void find_ans(int ands, long long ans) {
    if (ands == prime.size()) {
        if ((ans > 1) and (ans < mn_ans) and check(ans)) {
            mn_ans = ans;
        }

        return;
    }

    find_ans(ands + 1, ans * prime[ands]);
    find_ans(ands + 1, ans);
}

int main() {
    ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    sz = input<int>();
    for (int i = 0; i < sz; i++) {
        arr[i] = input<int>();

        int val = arr[i];
        for (int j = 2; j * j <= val; j++) {
            if (val % j == 0) {
                come[j] = true;
                while (val % j == 0) {
                    val /= j;
                }
            }
        }
        if (val > 1) {
            come[val] = true;
        }
    }
    for (int i = 0; i < max_nm; i++) {
        if (come[i]) {
            prime.push_back(i);
        }
    }

    find_ans(0, 1);

    cout << mn_ans;
    return 0;
}
