#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int rem = 1, ans = 0;
  for (int i = 0; i < s.length(); ++i) {
    int x = s[i] - '0';
    if (((x + rem) & 1) != x) ans++;
    rem = (x + rem) >> 1;
  }
  cout << ans;
  return 0;
}
