#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p = 1, ans = 0, pred;
  char x;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    pred = x - '0';
    x += p - '0';
    p = 0;
    if (x > 1) {
      x = 0;
      p = 1;
    }
    if (x != pred) ++ans;
  }
  cout << ans;
  return 0;
}
