#include <bits/stdc++.h>
int main() {
  int n, i, temp = 0;
  char arr[111] = {
      0,
  };
  int realarr[111] = {
      0,
  };
  int bit_number;
  int result = 0;
  scanf("%d", &n);
  scanf("%s", arr);
  for (i = 0; i < n; i++) {
    realarr[i] = arr[i] - 48;
  }
  realarr[0] += 1;
  for (i = 0; i < n; i++) {
    if ((realarr[i] + temp) / 2 == 1) {
      temp = (realarr[i] + temp) / 2;
      realarr[i] = 0;
      result++;
    } else {
      result++;
      break;
    }
  }
  printf("%d\n", result);
  return 0;
}
