whar is wrong with this code??
package com.codegym.task.task05.task0507;
/*
Arithmetic mean
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Solution {
public static void main(String[] args) throws Exception {
int n = 0;
int count = 0;
double result;
for (int i = 1; ; i++) {
count++;
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int a = Integer.parseInt(reader.readLine());
if (a != -1){
count++;
}
else if (a == -1){
result =(double)n/count;
System.out.println(result);
break;
}
}
}
}