#include using namespace std; typedef long long ll; int main() { string s; cin >> s; if(s[0] == 'x'){ cout << (ll)pow(2, 32) - stoll(s.substr(1)) << endl; } else { cout << stoi(s) << endl; } return 0; }