#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long int modexp(long long int a, long long int b) {
  if (b == 0) return 1;
  if (b == 1) return a;
  long long int temp = modexp(a, (b >> 1));
  temp = (temp * temp);
  return (temp * modexp(a, b & 1));
}
long long int modexp(long long int a, long long int b, long long int m) {
  if (b == 0) return 1;
  if (b == 1) return a % m;
  long long int temp = modexp(a, (b >> 1), m);
  temp = (temp * temp) % m;
  return (temp * modexp(a, b & 1, m)) % m;
}
long long int modinv(long long int a, long long int p) {
  return modexp(a, p - 2, p);
}
int main() {
  int a0 = 0, b0 = 0, b1 = 0, a1 = 0;
  string a, b;
  int n;
  scanf("%d", &n);
  cin >> a >> b;
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    if (a[i] == '0')
      a0++;
    else
      a1++;
  }
  for (int i = 0; i < n; ++i) {
    if (b[i] == '0')
      b0++;
    else
      b1++;
  }
  for (int i = 0; i < n; ++i)
    if (a[i] != b[i]) ans++;
  for (int i = 1; i < n; i++)
    if ((a[i] != b[i]) && (a[i - 1] != b[i - 1]) && (a[i] == b[i - 1]) &&
        (a[i - 1] == b[i])) {
      ans--;
      i++;
    }
  printf("%d\n", ans);
}
