import java.util.Scanner; /** * Created by Alexandru on 2/16/2015. */ public class prog { public static int a, n, l, nr; public static void main (String[] args) { Scanner s= new Scanner(System.in); n= s.nextInt(); a=0; for(int i=1;i<=n;i++) { l=s.nextInt(); if(a==1 && l==1) { nr++; l = 0; } a=l; } System.out.print(nr); System.out.print('\n'); } }