#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma comment(linker, "/STACK:936777216")
using namespace std;
int OO = 0x3f3f3f3f;
const int MAX = 100000000;
char vis[MAX / 8 + 1];
void setVisited(int i) { vis[i >> 3] |= (1 << (i & 7)); }
bool isVisited(int i) { return vis[i >> 3] & (1 << (i & 7)); }
int arr[1000005];
int n, a;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  string s1, s2;
  cin >> s1 >> s2;
  long long cost = 0;
  for (int i = 0; i < s1.size(); i++) {
    if (s1[i] != s2[i]) {
      if (i < s1.size() && s1[i + 1] == s2[i] && s2[i + 1] == s1[i]) {
        swap(s1[i], s1[i + 1]);
        cost += 1;
      } else if (s1[i] != s2[i]) {
        cost += 1;
        if (s1[i] == '0')
          s1[i] = '1';
        else
          s1[i] = '0';
      }
    }
  }
  cout << cost << '\n';
}
