#include <bits/stdc++.h>
using namespace std;
int changedBits(char *s, int n);
int main() {
  char *s = (char *)malloc(101 * sizeof(char));
  int n;
  cin >> n;
  cin >> s;
  ;
  fflush(stdin);
  cout << changedBits(s, n);
}
int changedBits(char *s, int n) {
  int count = 0;
  int i = 0;
  s[strlen(s)] = '0';
  s[strlen(s) + 1] = '\0';
  while (s[i] == '1') {
    count++;
    i++;
  }
  if (i < n) count++;
  if (count > n) count = n;
  return count;
}
