#include <bits/stdc++.h>
using namespace std;
int main() {
  long long answer = 0, i = 0, n;
  string a, b;
  cin >> n >> a >> b;
  while (i < n - 1) {
    if (a[i] != b[i]) {
      if (a[i + 1] != b[i + 1] && a[i + 1] != a[i]) {
        swap(a[i], a[i + 1]);
        answer++;
      } else {
        answer++;
        a[i] = (a[i] - '0' + 1) % 2 + '0';
      }
    }
    i++;
  }
  if (a[n - 1] != b[n - 1]) answer++;
  cout << answer;
  return 0;
}
