#include using namespace std; int main() { int N; string S; cin >> N >> S; int operations = 0; int zeroCount = 0; for (int i = 0; i < N; ++i) { if (S[i] == '0') { zeroCount++; } else { if (zeroCount > 0) { operations += max(0, zeroCount - 1); zeroCount = 0; } } } if (zeroCount > 0) { operations += max(0, zeroCount - 1); } cout << operations << endl; return 0; }