#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n), u(n);
  string str;
  cin >> str;
  for (int i = 0; i < n; i++) v[i] = str[i] - '0';
  int carry = 1, ans = 0;
  for (int i = 0; i < n; i++) {
    u[i] = v[i] ^ carry;
    carry &= v[i];
    if (u[i] != v[i]) ans++;
  }
  cout << ans << endl;
  return 0;
}
