#include<stdio.h>
#include<algorithm>
#include<iostream>
#include<string.h>
#include<string>
using namespace std;
int shu1,shu2,shu3,shu4;
int shu;
int main()
{
	cin>>shu1>>shu2>>shu3>>shu4;
	shu=min(shu1,min(shu2,min(shu3,shu4))) ;
	cout<<shu;
}
#include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int h, w, a, b;
    cin >> h >> w >> a >> b;
    int t = h * w;
    int m = 1 << (h * w);
    int dp[m][a + 1];
    memset(dp, 0, sizeof dp);
    dp[0][0] = 1;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            for (int k = 0; k < (1 << (i * w + j)); k++) {
                for (int l = 0; l < a; l++) {
                    if (i > 0) {
                        int temp = (1 << (i * w - w + j)) | (1 << (i * w + j));
                        if ((temp & k) == 0)
                            dp[temp | k][l + 1] += dp[k][l];
                    }
                    if (j > 0) {
                        int temp = (1 << (i * w - 1 + j)) | (1 << (i * w + j));
                        if ((temp & k) == 0)
                            dp[temp | k][l + 1] += dp[k][l];
                    }
                }
            }
        }
    }
    int ans = 0;
    for (int i = 0; i < m; i++) {
        ans += dp[i][a];
    }
    cout << ans << endl;
    return 0;
}