#include #include using namespace atcoder; using namespace std; using ll=long long; using ld=double; ld pie=3.14159265359; ll mod=998244353; ll inf=100000; ll modpow(ll x, ll n) { if(n==0) return 1; //再帰の終了条件 else if(n%2==1) { return (x*modpow(x, n-1)); //nが奇数ならnを1ずらす } else return modpow((x*x), n/2); //nが偶数ならnが半分になる } int main(){ string s; cin >> s; if (s[0]!='x') { cout << s << endl; }else{ reverse(s.begin(),s.end()); s.pop_back(); reverse(s.begin(),s.end()); ll x=stoll(s); cout << modpow(2,32)-x << endl; } }