#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string arr1, arr2;
  cin >> arr1 >> arr2;
  int tot = 0;
  for (int i = 0; i < n - 1; i++) {
    if (arr1[i] == '1' && arr1[i + 1] == '0' && arr2[i] == '0' &&
        arr2[i + 1] == '1') {
      tot++;
      swap(arr1[i], arr1[i + 1]);
    }
    if (arr2[i] == '1' && arr2[i + 1] == '0' && arr1[i] == '0' &&
        arr1[i + 1] == '1') {
      tot++;
      swap(arr1[i], arr1[i + 1]);
    }
  }
  for (int i = 0; i < n; i++) {
    if (arr1[i] != arr2[i]) tot++;
  }
  cout << tot;
  return 0;
}
