import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long ans = Long.MAX_VALUE; for(int i=0; i= '0' && ret <= '9') { return ret - '0' + 1; } else if(ret >= 'A' && ret <= 'Z') { return ret - 'A' + 10 + 1; } else { throw new IllegalArgumentException("ret:"+ret); } } }