#include <bits/stdc++.h>
using namespace std;
char a[1000010];
char b[1000010];
int dp[1000010];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  memset(dp, 0x3f, sizeof dp);
  int n;
  cin >> n;
  cin >> a + 1;
  cin >> b + 1;
  if (a[n] == b[n])
    dp[n] = 0;
  else {
    if (a[n - 1] == b[n] && a[n - 1] != b[n - 1]) {
      dp[n] = 1;
      a[n - 1] = a[n];
    } else {
      dp[n] = 1;
    }
  }
  for (int i = n - 1; i >= 1; i--) {
    if (a[i] == b[i]) {
      dp[i] = dp[i + 1];
    } else {
      if (a[i - 1] == b[i] && a[i - 1] != b[i - 1]) {
        dp[i] = dp[i + 1] + 1;
        a[i - 1] = a[i];
      } else {
        dp[i] = dp[i + 1] + 1;
      }
    }
  }
  cout << dp[1] << endl;
}
