#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for(int i=0;i<int(n);i++) int main(){ string s; cin>>s; ll nw; if(s.at(0)=='x'){ string b=s.substr(1); nw=(1LL<<32)-stoll(b); }else{ nw=stoll(s); } cout<<nw<<endl; }