#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const int MAX = 200005;
void run() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
}
void printvi(vector<int> arr) {
  for (int i = 0; i < (int)(((int)((arr).size()))); i++) cout << arr[i] << " ";
  cout << endl;
}
void printvll(vector<long long> arr) {
  for (int i = 0; i < (int)(((int)((arr).size()))); i++) cout << arr[i] << " ";
  cout << endl;
}
void solve() {
  int n;
  cin >> (n);
  string a, b;
  cin >> (a), cin >> (b);
  int res = 0;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] == '0' && a[i + 1] == '1' && b[i] == '1' && b[i + 1] == '0')
      res++, a[i] = '1', a[i + 1] = '0';
    if (a[i] == '1' && a[i + 1] == '0' && b[i] == '0' && b[i + 1] == '1')
      res++, a[i] = '0', a[i + 1] = '1';
  }
  for (int i = 0; i < (int)(n); i++) res += a[i] != b[i];
  cout << (res) << endl;
}
int main() {
  run();
  solve();
  return 0;
}
