include

using namespace std;

int main()
{
int str;
while (cin >> hex >> str)
{
cout << dec << str << endl;
}
return 0;
}