#include <iostream>

using namespace std;

int main(int, char**)
{
    uint32_t n;
    cin >> hex >> n;
    cout << n << endl;
}