#define _USE_MATH_DEFINES #include using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; string s; cin >> s; int one = 0; int ans = 0; for (char c : s) { if (c == '1') { if (one) ans++; one ^= 1; } else if (c != '9') ans++; } cout << ans << '\n'; return 0; }