#include <iostream>
using namespace std;
int main ()
{
long long a,b,c,d;
cin >>a >>b >>c >>d;
cout <<min(min(a,b),min(c,d));
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbiAoKQp7CiAgbG9uZyBsb25nIGEsYixjLGQ7CiAgY2luID4+YSA+PmIgPj5jID4+ZDsKICBjb3V0IDw8bWluKG1pbihhLGIpLG1pbihjLGQpKTsKfQ==