Como mostrar quantas possibilidades a msm variável pode ter?

Bom dia!
Estou com uma questão onde tenho que mostrar números divisíveis por 3 e 6 ao mesmo tempo e exibir quantos são, consegui chegar ate aqui
Scanner in = new Scanner(System.in);
int x, y;
x = in.nextInt();
do{
y = in.nextInt();
}while (y < x);
for(int i = x; i <= y; i++){
if (i % 3 == 0 & i % 6 == 0){
System.out.println(i);}
}
Porém não estou conseguindo mostrar quantos são, alguém consegue me ajudar?

import java.util.Scanner;

public class Exemplo {

    private static final Scanner in = new Scanner(System.in);

    public static void main(String[] args) {
        System.out.print("De:  ");
        int de = Integer.parseInt(in.nextLine());
        System.out.print("Até: ");
        int ate = Integer.parseInt(in.nextLine());
        int total = 0;
        System.out.printf("Números entre %d e %d divisíveis por 3 e 6:%n", de, ate);
        for (int numero = de; numero <= ate; numero++) {
            if (numero % 3 == 0 && numero % 6 == 0) {
                total++;
                System.out.printf("    %d%n", numero);
            }
        }
        System.out.printf("Total de números: %d%n", total);
    }
}

Exemplo de saída:

De:  11
Até: 37
Números entre 11 e 37 divisíveis por 3 e 6:
    12
    18
    24
    30
    36
Total de números: 5
1 curtida