#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  t = 1;
  while (t--) {
    long long n, i, j, w, h, count = 0, sum = 0, total, k, T, breaks = 0,
                             bothzero = 0, a1b0 = 0, azero = 0, ones;
    string s, a, b;
    cin >> n;
    cin >> a >> b;
    for (i = 0; i < n; i++) {
      if (a[i] == '0' && b[i] == '0') {
        bothzero++;
      }
      if (a[i] == '1' && b[i] == '0') {
        a1b0++;
      }
      if (a[i] == '0') {
        azero++;
      }
    }
    ones = n - azero;
    sum = sum + ones * bothzero;
    sum = sum + a1b0 * (azero - bothzero);
    cout << sum << endl;
  }
}
