#include <bits/stdc++.h>
using namespace std;
const int Max = 1e5 + 110;
int main() {
  int n;
  string str;
  cin >> n >> str;
  int i = 0, ans = 0;
  while (i < n && str[i++] == '1') ans++;
  int k = 0;
  for (int i = 0; i < str.size(); i++)
    if (str[i] == '0') k++;
  if (k) ans++;
  cout << ans;
}
