#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(ll i=0;i> N >> S; vector v; REP(i,N) if(S[i]=='1') v.push_back(i); ll n=v.size(); if(n==0 || n==1){ cout << n << endl; return 0; } vector u; for(i=1;i