#include <bits/stdc++.h>
using namespace std;
bool rest = false;
string second;
int N, ans;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> N;
  cin >> second;
  for (int i = 0; i < N; i++) {
    if (i == 0 && second[i] == '1')
      rest = 1;
    else if (i == 0)
      ans++;
    if (rest) ans++;
    if (second[i] == '0') rest = 0;
  }
  cout << ans;
  return 0;
}
