#import int q,i,k,c[1<<22];main(){for(scanf("%d",c);i++^*c;q+=c[i]==3)for(k=1;k++