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