#include using namespace std; int main(){ string S; cin >> S; if(S[0] == 'x'){ S[0] = '0'; cout << (1L << 32) - stol(S); } else cout << S; }