/**
 * サンプル問題 解答例
 */

import java.io.*;
import java.util.Scanner;

public class Sample {
  public static void main(String[] args) throws IOException {
    Scanner sc = new Scanner(System.in);
    
    int max = 0;
    
    // ループ
    while(true){
      // 入力
      int n = sc.nextInt();
      // 文字列を読み込みたい場合は、下のように書く。
      // String str = sc.next();
      
      // 終了条件
      if(n == 0) break;
      
      // 処理
      // 処理が複雑な場合はメソッドを呼ぶ。
      if(n > max) max = n;
    }
    
    // 出力
    // 問題によってはループ中に書く。
    System.out.println(max);
    
    sc.close();
  }
}
