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