s = input()
if s[0] == 'x':
    ans = pow(2, 32) - int(s[1:])
else:
    ans = int(s)
print(ans)