I can't find the error.
package com.codegym.task.task04.task0442;
/*
Adding
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
int sum = 0;
while (true) {
int num = Integer.parseInt(read.readLine());
if (num == -1)
break;
}
if (num >= -1)
sum += num;
System.out.println(sum);
}
}