import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); int N = input.nextInt(); int m = 0; while(N >= 1) { if(N%10 > m) { m = N%10; } N = N / 10; } System.out.print(m); input.close(); } }