// import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); if (s.charAt(0) == 'x') System.out.println((1L<<32)-Integer.parseInt(s.substring(1))); else System.out.println(Integer.parseInt(s)); sc.close(); } }