#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  getchar();
  string cade;
  cin >> cade;
  int vec[cade.size()];
  int ac = 0;
  int sol = 0;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      if (cade[i] - '0' + 1 == 2) {
        ac = 1;
        sol = 0;
      } else {
        ac = 0;
        sol = 1;
      }
    } else {
      if (cade[i] - '0' + ac == 2) {
        ac = 1;
        sol = 0;
      } else {
        if (cade[i] - '0' + ac == 0) {
          ac = sol = 0;
        } else {
          ac = 0;
          sol = 1;
        }
      }
    }
    if (sol != cade[i] - '0') {
      ans++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
