#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = 10 * x + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, a[500 + 100], b[500 + 100];
int main() {
  n = read();
  for (int i = 1; i <= (n); i++) {
    char ch = ' ';
    while (ch != '0' && ch != '1') ch = getchar();
    b[i] = a[i] = ch == '1';
  }
  a[1] += 1;
  int i = 1;
  while (a[i] == 2) {
    a[i] = 0;
    i++;
    a[i]++;
  }
  int ans = 0;
  for (int i = 1; i <= (n); i++)
    if (a[i] != b[i]) ans++;
  cout << ans << endl;
  return 0;
}
