#include #include int main() { int v[32000],n,i,j,ok=0,l; scanf("%d",&n); scanf("%d",&v[1]); for(i=2;i<=n;i++) { scanf("%d",&v[i]); if(v[i]==v[i-1]&&v[i-1]==1) { ok++; v[i]=0; } }printf("%d",ok); return 0; }