import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); String [] S = new String [N]; for(int i=0; i='0' && u[j]<='9'){ u[j]-='0'; }else{ u[j]=u[j]-'A'+10; } max=Math.max(max,u[j]); } long num=0; for(int j=0; j