#include <bits/stdc++.h>
using namespace std;
char a[110], k;
int b[110], tot, n;
int main() {
  cin >> n;
  k = getchar();
  cin.getline(a, 110);
  b[0] = 1;
  for (int i = 0; i < strlen(a); i++) {
    b[i] += a[i] - '0';
    if (b[i] != a[i] - '0') tot++;
    if (b[i] > 1) {
      b[i + 1] += b[i] / 2;
      b[i] %= 2;
    }
  }
  cout << tot << "\n";
  return 0;
}
