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