#include <bits/stdc++.h>
using namespace std;
void citire();
void rez();
void afis();
string a, b;
int n, ans;
int main() {
  cin >> n;
  cin >> a >> b;
  for (int i = 1; i < a.size() + 1; i++) {
    if (a[i - 1] != b[i - 1] and a[i] != b[i] and a[i - 1] != a[i]) {
      swap(a[i - 1], a[i]);
      ans++;
    } else if (a[i - 1] != b[i - 1]) {
      if (a[i - 1] == '0')
        a[i - 1] = '1';
      else
        a[i - 1] = '0';
      ans++;
    }
  }
  cout << ans;
}
