import java.util.*;
import java.io.*;

public class ProbTwo
{
	public static void main(String[] args) throws IOException
	{
		Scanner in = new Scanner(new FileReader("DATA2.txt"));
		PrintWriter out = new PrintWriter(new FileWriter("OUT2.txt"));

		while (in.hasNextLine())
		{
			String data = in.nextLine();
			String temp;
			ArrayList<Integer> nums = new ArrayList<Integer>();

			for (int i = 0; i < data.length(); i++)
			{
				temp = data.substring(i, i+1);
				nums.add(Integer.parseInt(temp));
			}

			int number = getMax(nums);

			out.println(number);
		}
		out.close();
	}

	public static int getMax(ArrayList<Integer> blah)
	{
		int max = 0;
		for (int j = 0; j < blah.size(); j++)
		{
			if (blah.get(j).intValue() > max)
				max = blah.get(j).intValue();
		}

		return max;
	}
}

