#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main() {
    int arr[4];
    int a;
    for(int i=0;i<4;i++){
        cin>>a;
        arr[i]=a;
    }
    cout << *min_element(arr,arr+4) << endl;
    return 0;
}
// https://atcoder.jp/contests/abc185/tasks/abc185_a
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n - 1; i >= 0; i--)
#define ALL(x) x.begin(), x.end()
using str = string;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvl = vector<vector<ll>>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int main() {
    int ans = 100;
    rep(i, 4) {
        int a;
        cin >> a;
        ans = min(ans, a);
    }
    cout << ans << endl;
}
