#include <bits/stdc++.h>
using namespace std;
char ss[(100 + 5)];
int s[(100 + 5)], t[(100 + 5)], tt[(100 + 5)] = {1};
int main() {
  int n;
  while (scanf("%d", &n) == 1) {
    scanf("%s", ss);
    for (int i = 0; i < n; i++) s[i] = ss[i] - '0';
    int c = 0;
    for (int i = 0; i < n; i++) {
      int d = s[i] + tt[i] + c;
      t[i] = d % 2;
      c = d / 2;
    }
    int cnt = 0;
    for (int i = 0; i < n; i++)
      if (t[i] != s[i]) cnt++;
    printf("%d\n", cnt);
  }
  return 0;
}
