#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string a, b;
  bool vis[2000000];
  for (int i = 0; i < 100; i++) vis[i] = false;
  cin >> n;
  cin >> a >> b;
  for (int i = 0; i < n; i++) {
    if (a[i] == '0' and a[i + 1] == '1' and b[i] == '1' and b[i + 1] == '0' or
        a[i] == '1' and a[i + 1] == '0' and b[i] == '0' and b[i + 1] == '1') {
      vis[i] = true;
      vis[i + 1] = true;
      i++;
    }
  }
  int c = 0;
  for (int i = 0; i < n; i++)
    if (vis[i] == true) c++;
  c = c / 2;
  for (int i = 0; i < n; i++)
    if (vis[i] == false and a[i] != b[i]) c++;
  cout << c;
}
