//60%多的通过率
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner scanner = new Scanner(System.in);
int max = 0;
while(scanner.hasNext()){
String input = scanner.nextLine();
String[] str = input.split(" ");
int[] a = new int[str.length];
for(int i = 0; i < str.length; i ++){
String re = str[i];
a[i] = Integer.parseInt(re);
}
int n = str.length;
for(int i = 0; i < n; i ++){
int sum = 0;
int aj = 0;
for(int j = i; j < n; j ++)
if((j+1) < input.length()){
aj = a[j];
if((sum+aj) > max){
max = sum+aj;
}
sum= sum + aj;
aj = 0;
}
}
System.out.println(max);
}
}
}