не понимаю почему программа не считает сумму
package com.javarush.task.pro.task04.task0403;
import java.util.Scanner;
/*
Суммирование
*/
public class Solution {
public static void main(String[] args) {
Scanner console = new Scanner (System.in);
int sum = 0;
boolean a = false;
while (!a) {
if (console.hasNextInt()) {
sum = sum + console.nextInt(); }
else if (console.hasNextLine()) {
String text = console.nextLine();
if (text.equals("ENTER"))
a = true;
}
{
System.out.println(sum);
}
}
}
}