#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 1e6 + 6;
char s1[maxn], s2[maxn];
int n, vis[maxn];
int main(int argc, char* argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  cin >> s1 >> s2;
  int ans = 0;
  memset(vis, -1, sizeof vis);
  for (int i = 0; i < n; i++) {
    if (s1[i] != s2[i] && s1[i] == '1')
      vis[i] = 1;
    else if (s1[i] != s2[i] && s1[i] == '0')
      vis[i] = 0;
  }
  for (int i = 0; i < n; i++) {
    if (vis[i] == 1) {
      if (vis[i + 1] == 0)
        ans++, i++;
      else
        ans++;
    } else if (vis[i] == 0) {
      if (vis[i + 1] == 1)
        ans++, i++;
      else
        ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
