#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s1, s2, s3 = "";
  cin >> s1 >> s2;
  for (int i = 0; i < n; i++) {
    s3 += to_string(((s1[i] - '0') + (s2[i] - '0')) % 2);
  }
  s3 += '0';
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (s3[i] == '1') {
      if (s3[i + 1] == '1') {
        if (s2[i] == '0' && s2[i + 1] == '0')
          count++;
        else if (s2[i] == '0' && s2[i + 1] == '1') {
          count++;
          i++;
        } else if (s2[i] == '1' && s2[i + 1] == '0') {
          count++;
          i++;
        } else if (s2[i] == '1' && s2[i + 1] == '1')
          count++;
      } else {
        count++;
      }
    }
  }
  cout << count;
}
