#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int c = 0;
  for (int i = 0; i < n; i++) {
    char t;
    cin >> t;
    if (t == '1')
      c++;
    else
      break;
  }
  cout << min(n, c + 1);
}
