s = str(input()) if s[0] == 'x': ss = s[1:] print((1 << 32) - int(ss)) else: print(s)