appreciate you feedback on my code's issue.
package com.codegym.task.task05.task0507;
import java.io.*;
/*
Arithmetic mean
*/
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
int input, counter = 0, sum = 0;
double mean=0.0;
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
while(true){
input = Integer.parseInt(reader.readLine());
if(input == -1){
break;
}
sum = sum + input;
counter++;
}
if(counter != 0)
mean = (sum/counter);
else
mean = 0.0;
System.out.println(mean);
}
}