#include #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; int main() { int n; string s; cin >> n >> s; int ans = 0; rep(i, n) if (s[i] == '0') { int l = i; while (i < n and s[i] == '0') ++i; int r = i; ans += r-l-1; } cout << ans << '\n'; return 0; }