how to count even and odd in java