import java.util.*;
import java.lang.*;
import java.io.*;

// The main method must be in a class named "Main".
class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int[] arr=new int[n];
        for(int i=0;i<n;i++){
            arr[i]=sc.nextInt();
        }

        int count=0;
       char[] ch=new char[1];
         ch[0]  = (arr[0]%2==0)?'r':'g';
        for(int i=1;i<n;i++){
            if(arr[i]%2!=0){
                if(ch[0]=='g'){
                    count++;
                    ch[0]='r';
                }
            }
            else{
                ch[0]='g';
            }
        }
        System.out.println(count);
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: