#include <bits/stdc++.h>
int main(int argc, const char* argv[]) {
  int n;
  std::cin >> n;
  std::string s;
  std::cin >> s;
  std::vector<int> v0(n);
  for (int i = 0; i < n; i++) v0[i] = s[i] - '0';
  bool add = true;
  std::vector<int> v1(n);
  for (int i = 0; i < n; i++) {
    if (add)
      v1[i] = v0[i] + 1;
    else
      v1[i] = v0[i];
    if (v1[i] == 2) {
      add = true;
      v1[i] = 0;
    } else
      add = false;
  }
  int count = 0;
  for (int i = 0; i < n; i++)
    if (v0[i] != v1[i]) count++;
  std::cout << count << std::endl;
  return 0;
}
