import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
int sum = 0;
while(N!=0) {
if(N>0) {
sum+=N;
}
N = scanner.nextInt();
}
System.out.println(sum);
}
}