#include <bits/stdc++.h>
using namespace std;
string a, b;
int main() {
  int n;
  while (cin >> n) {
    cin >> a >> b;
    long long cnt10 = 0, cnt00 = 0, cnt0 = 0, cnt1 = 0;
    for (int i = 0; i < n; ++i) {
      if (a[i] == '1' && b[i] == '0') cnt10++;
      if (a[i] == '0' && b[i] == '0') cnt00++;
      if (a[i] == '0') cnt0++;
      if (a[i] == '1') cnt1++;
    }
    long long ans = cnt10 * cnt0 - cnt00 * cnt10 + cnt00 * cnt1;
    printf("%lld\n", ans);
  }
  return 0;
}
