Here my program will output 2, i am not sure why.

package com.codegym.task.task04.task0428;
/*
Positive number
*/
import java.io.*;
import java.util.Arrays;
public class Solution{
public static void main(String[] args) throws Exception{
BufferedReader key = new BufferedReader(new InputStreamReader(System.in));
int [] a ={Integer.parseInt(key.readLine()),
Integer.parseInt(key.readLine()),
Integer.parseInt(key.readLine())
};
int count=0; //zero is not a positive or negative number
for(int i=0;i<a.length-1;i++){
if(a[0]>0){
count++;
}
if(a[1]>0){
count++;
}
if(a[2]>0){
count++;
}
}
System.out.print(count);
}
}