Why Does The Last Condition Doesn't Met Even Though The Output Is Correct?

package com.codegym.task.task05.task0507;
/*
Arithmetic mean
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Solution {
public static void main(String[] args) throws IOException {
//write your code here
double total=0;
double count=0;
double zero=0;
while(true){
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int number = Integer.parseInt(reader.readLine());
if(number<0){
//System.out.println("0.0");
break;
}
total += number;
count++;
}
if(total/count >= 0){
System.out.println(total/count);
}else{
System.out.println(0.0);
}
}
}