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