import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String N = scan.next(); char max = '0'; for(int i = 0; i < N.length(); i++) { if(N.charAt(i) > max) max = N.charAt(i); } System.out.println(max); } }