#include <bits/stdc++.h>
using namespace std;
void data() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
}
int dx[5] = {-1, 0, 0, 1};
int dy[5] = {0, -1, 1, 0};
const int N = 2e5 + 100;
const long long mod = 1e9 + 7;
const long long big = 1e9;
const long long p = 27;
bool comp(pair<int, int> a, pair<int, int> b) {
  if (a.first > b.first) {
    return 1;
  } else if (a.first < b.first) {
    return 0;
  }
  return (a.second < b.second);
}
int main() {
  data();
  long long n;
  cin >> n;
  string a, b;
  cin >> a >> b;
  long long f = 0, s = 0, f2 = 0, s2 = 0;
  for (long long i = 0; i < a.size(); i++) {
    if (a[i] == b[i] && a[i] == '0') {
      f++;
    } else if (a[i] == b[i] && b[i] == '1') {
      s++;
    } else if (a[i] == '1') {
      f2++;
    } else {
      s2++;
    }
  }
  long long ans = 0;
  for (long long i = 0; i < a.size(); i++) {
    if (a[i] == '0' && b[i] == '1') {
      ans += f2;
    } else if (a[i] == '1' && b[i] == '0') {
      ans += s2;
      ans += f;
    } else if (a[i] == '1') {
      ans += f;
    } else {
      ans += s;
      ans += f2;
    }
  }
  cout << ans / 2;
}
