#include using namespace std; int main() { int n,i,nr,ante,ans=0; cin>>n; cin>>ante; for(i=1;i>nr; if(ante && nr) { nr=0; ans++; } ante=nr; } cout<