#include <bits/stdc++.h>
using namespace std;
int N;
string s;
int main() {
  std::ios::sync_with_stdio(false);
  cin >> N >> s;
  int res = 0;
  int idx = 0;
  s[idx] += 1;
  res++;
  while (s[idx] == '2') {
    s[idx] = '0';
    if (idx + 1 < s.size()) {
      s[idx + 1] += 1;
      res++;
      idx++;
    }
  }
  cout << res << endl;
  return 0;
}
