//#include <bits/stdc++.h>
#include <queue>
#include <iostream>
#include <iomanip>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <string>
#define F(i, a, b) for(register int i = a, i##end = b; i <= i##end; i++)
#define UF(i, a, b) for(register int i = a, i##end = b; i >= i##end; i--)
#define ll long long
using namespace std;
inline int read() 
{
    int x = 0;
    bool fu = 0;
    char ch = 0;
    while(ch > '9' || ch < '0') 
    {
        ch = getchar();
        if(ch == '-')
            fu = 1;
    }
    while(ch <= '9' && ch >= '0') 
        x = (x * 10 - 48 + ch), ch = getchar();
    return fu ? -x : x;
}
int main()
{
    int ans = read();
    ans = min(ans, read());
    ans = min(ans, read());
    ans = min(ans, read());
    cout << ans;
    getchar();
    return 0;
}
//#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <ctime>
#include <cassert>
#include <complex>
#include <cstring>
#include <chrono>
#include <random>

#define  pb          push_back
#define  f           first
#define  s           second
#define  pi          acos(-1.0)
#define  LCM(a,b)    a*b/__gcd(a,b)
#define  GCD(a,b)    __gcd(a,b)
#define  mod         1000000007
#define  test        int t; cin>>t; while(t--)
#define  sof         sizeof
#define  endl        '\n'

typedef long long ll;
using namespace std;

/*
          Run, Rabbit run
          Dig that hole, forget the sun
          And when at last the work is done
          Don't sit down, 
          it's time to dig another one
          _Breathe(Pink Floyd) 
*/


int main()
{
 
       ios::sync_with_stdio(false);
       cin.tie(0); 
       
         int a,b,c,d;
         cin>>a>>b>>c>>d;
         cout<<min(min(a,b),min(c,d));
         


        

     return 0;     
      
}