#include <bits/stdc++.h>
using namespace std;
int n;
char s[105];
char kq[105];
char cong[105];
int dem;
void reset_bien() {
  int i;
  for (i = 0; i < 105; i++) {
    s[i] = 0;
    kq[i] = 0;
    cong[i] = 0;
  }
  cong[0] = 1;
  dem = 0;
}
void input() {
  scanf("%d", &n);
  scanf("%s", s);
}
void solve() {
  int i, j;
  int nho;
  for (i = 0; i < n; i++) {
    s[i] = s[i] - '0';
    kq[i] = kq[i] + s[i] + cong[i];
    if (kq[i] == 2) {
      kq[i] = 0;
      kq[i + 1] = 1;
    }
    if (kq[i] != s[i]) dem++;
  }
  printf("%d\n", dem);
}
int main() {
  int itest, ntest;
  {
    reset_bien();
    input();
    solve();
  }
  return 0;
}
