#include<iostream>
using namespace std;
int main ()
{
    long long brKerosin, brBenzin, otkarvat;
    char kerosin, benzin;
    cin>>brKerosin>>kerosin>>brBenzin>>benzin>>otkarvat;
    if(otkarvat<=brKerosin)
    {
        cout<<brKerosin;
    }
    else
    {
        cout<<otkarvat;
    }
    return 0;
}
