#include <bits/stdc++.h>
using namespace std;
signed main(){
int n; cin >> n;
string a, b; cin >> a >> b;
int ans = 0;
for ( int i = 0; i < n; i++ ){
if ( b[i] != '1' ) continue;
int j = i;
while ( b[j] == '1' ) j++;
i = j; ans += 1;
}
cout << ans << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |