using static System.Console;
public class Program {
public static void Main() {
if (!int.TryParse(ReadLine(), out var n)) return;
var numeros = new int[n];
string[] entrada = ReadLine().Split(' ');
for (var i = 0; i < n; i++) {
if (!int.TryParse(entrada[i], out var valor)) return;
numeros[i] = valor;
}
var quantidade = 0;
for (var i = 0; i < n; i++) {
if (numeros[i] % 2 == 0) {
Write($"{numeros[i]} ");
quantidade++;
}
}
WriteLine();
WriteLine(quantidade);
}
}
//https://pt.stackoverflow.com/q/432239/101
dXNpbmcgc3RhdGljIFN5c3RlbS5Db25zb2xlOwoKcHVibGljIGNsYXNzIFByb2dyYW0gewoJcHVibGljIHN0YXRpYyB2b2lkIE1haW4oKSB7CiAgICAgICAgaWYgKCFpbnQuVHJ5UGFyc2UoUmVhZExpbmUoKSwgb3V0IHZhciBuKSkgcmV0dXJuOwogICAgICAgIHZhciBudW1lcm9zID0gbmV3IGludFtuXTsKICAgICAgICBzdHJpbmdbXSBlbnRyYWRhID0gUmVhZExpbmUoKS5TcGxpdCgnICcpOwogICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbjsgaSsrKSB7CgkJCWlmICghaW50LlRyeVBhcnNlKGVudHJhZGFbaV0sIG91dCB2YXIgdmFsb3IpKSByZXR1cm47CgkJCW51bWVyb3NbaV0gPSB2YWxvcjsKICAgICAgICB9CiAgICAgICAgdmFyIHF1YW50aWRhZGUgPSAwOwogICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbjsgaSsrKSB7CiAgICAgICAgICAgIGlmIChudW1lcm9zW2ldICUgMiA9PSAwKSB7CiAgICAgICAgICAgICAgICBXcml0ZSgkIntudW1lcm9zW2ldfSAiKTsKICAgICAgICAgICAgICAgIHF1YW50aWRhZGUrKzsKICAgICAgICAgICAgfQogICAgICAgIH0KCQlXcml0ZUxpbmUoKTsKICAgICAgICBXcml0ZUxpbmUocXVhbnRpZGFkZSk7Cgl9Cn0KCi8vaHR0cHM6Ly9wdC5zdGFja292ZXJmbG93LmNvbS9xLzQzMjIzOS8xMDE=