#include <bits/stdc++.h>
using namespace std;
struct abc {
  int marks, idx;
};
bool compareTwoProblems(abc a, abc b) {
  if (a.marks != b.marks) return a.marks > b.marks;
  return a.idx < b.idx;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  vector<int>::iterator it;
  vector<int> abc;
  int i, j, k, n, m, u, v, w, x, y, z;
  string s, t, s1, s2;
  cin >> n;
  cin >> s1 >> s2;
  s = s1;
  t = s2;
  i = 0;
  z = 0;
  while (i < n) {
    if (i == n - 1) {
      if (s[i] == t[i]) {
        break;
      } else {
        z++;
        break;
      }
    }
    x++;
    if (s[i] == t[i]) {
      i++;
      continue;
    } else {
      if (s[i] == '1') {
        if (s[i + 1] == t[i + 1]) {
          i += 2;
          z++;
          continue;
        } else {
          if (s[i + 1] == '0') {
            i += 2;
            z += 1;
          } else {
            i += 1;
            z += 1;
          }
          continue;
        }
      } else if (s[i] == '0') {
        if (s[i + 1] == t[i + 1]) {
          i += 2;
          z++;
          continue;
        } else {
          if (s[i + 1] == '0') {
            i += 1;
            z += 1;
          } else {
            i += 2;
            z++;
          }
          continue;
        }
      }
    }
  }
  cout << z << "\n";
  return 0;
}
