import java.io.*; import java.util.*; class Main { static String s; static int[]zero,one; static int g(int[]x,int a){ int ans=0; int[]oldx=x.clone(); int n=x.length; if(x[a]==1) if(a==n-1)return 0x3fffffff; else{ x[a]=0; x[a+1]=1-x[a+1]; ans+=2; } int p=a; int last=-1; for(int i=a;ilast){ ans+=Math.max(last-p,0); break; } x[p2]=1; x[p2+1]=1-x[p2+1]; if(last==p2+1)last=p2; ans+=p2-p+2; p=p2; } //System.err.println("g("+Arrays.toString(oldx)+","+a+")="+ans); return ans; } public static void main(String[] args) { MyScanner sc = new MyScanner(); out = new PrintWriter(new BufferedOutputStream(System.out)); int n=sc.nextInt()-1; s=sc.next(); int l=s.length(); int p=0,q=0; zero=new int[s.length()]; one=new int[s.length()]; for(int i=0;i