Java program to calculation the air conditioner capacity for invertor and non invertor

Java program to calculation the air conditioner capacity for invertor and non invertor. In order to place bulk orders, the Manager of Vasanth & Co showroom wants to know the stock of inverter and non-inverter air conditioners. As a result, the warehouse crew counts the inverter and non-inverter air conditioners individually, which are stored on racks. Using your Java abilities, assist them with counting.

import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int n;
System.out.println("Total count of Air Conditioner");
n = sc.nextInt();
sc.nextInt();
int count=0;
int count1=0;
String ac[] = new String[n];
System.out.println("List of Air Conditioners");
for (int i=0;i<n;i++){
ac[i] = sc.nextLine();
if(ac[i].equalsIgnoreCase("Inverter"))
{
count++;
}
else if(ac[i].equalsIgnoreCase("Non-Inverter"))
{
count1++;
}
else {
System.out.println(ac[i]+" Air Conditioner is not avaiable");
System.exit(0);
}
}
System.out.println("Inverter AC is of count "+count);
System.out.println("Non-Inverter AC is of count "+count1);
}
}

Output:

Total count of Air Conditioner
2
1
List of Air Conditioners
Air Conditioner is not avaiable