#include <iostream>
#include <vector>
#include<algorithm>
using namespace std;
int main(){
    //wczytanie danych
    int n;
    cin >> n;
    vector<bool> T1(n), T2(n);
    for(int i=0; i<n; i++) {
        char c;
        cin >> c;
        T1[i] = (c=='x');
    }
    for(int i=0; i<n; i++) {
        char c;
        cin >> c;
        T2[i] = (c=='x');
    }
    //wyznaczanie wartości
    int counter1 = 0, counter2 = 0;
    for(int i=0; i<n; i++) {
        int c1 = T1[i] + min(counter1, 1 + counter2);
        int c2 = T2[i] + min(counter2, 1 + counter1);
        counter1 = c1;
        counter2 = c2;
    }
    //wypisanie odpowiedzi
    cout << min(counter1, counter2);
}