#include <bits/stdc++.h>
int main() {
  int n, i;
  scanf("%d", &n);
  char s[100];
  int a[n], b[n], c[n];
  scanf("%s", s);
  for (i = 0; i < n; i++) {
    int h = (int)s[i];
    a[i] = h - 48;
  }
  for (i = 0; i < n; i++) {
    b[n - i - 1] = a[i];
    c[n - i - 1] = a[i];
  }
  i = n - 1;
  int c1 = 1;
  while (c1 == 1) {
    if (b[i] == 1) {
      c[i] = 0;
      c1 = 1;
      i--;
    } else if (b[i] == 0) {
      c[i] = 1;
      c1 = 0;
      i--;
    }
    if (i < 0) break;
  }
  int count = 0;
  for (i = 0; i < n; i++) {
    if (b[i] != c[i]) count++;
  }
  printf("%d\n", count);
}
