import java.util.Scanner;
public class Q1550 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String s = scan.next(); // 문자열로 받음
scan.close();
int result = Integer.parseInt(s, 16); // 16 자리에 다른 수를 넣으면 n진수
System.out.println(result);
}
}
문자열로 받은 후 Integer.parseInt(s, 16) 를 통해 정수값에 집어넣는다.