#include <bits/stdc++.h>
using namespace std;
int Set(int N, int p) { return N |= (1 << p); }
int Reset(int N, int p) { return N &= ~(1 << p); }
bool Check(int N, int p) { return N & (1 << p); }
const int dr[] = {0, -1, 0, 1, -1, -1, 1, 1};
const int dc[] = {1, 0, -1, 0, 1, -1, -1, 1};
const int maxx = 0;
int main() {
  int a;
  string s;
  cin >> a >> s;
  int cnt = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '1') cnt++;
  }
  if (cnt == a) {
    cout << a << endl;
    return 0;
  } else {
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '0') {
        cout << i + 1 << endl;
        return 0;
      }
    }
  }
  return 0;
}
