public class task4 {
    public static void main(String[] args) {
        int time = 0;
        for (int i = 1; i <= 100; i++) {
            if (i % 6 == 0) {
                System.out.print(i + " ");
                time += 1;
            }
        }
        System.out.println();
        System.out.println(time);
    }
}