#include <bits/stdc++.h>
using namespace std;
string s, t;
int n, ans;
int main() {
  cin >> n >> s;
  t = s;
  int i;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == '0') {
      s[i] = '1';
      break;
    }
    s[i] = '0';
  }
  for (int i = 0; i < s.size(); i++)
    if (s[i] != t[i]) ans++;
  cout << ans << endl;
  return 0;
}
