#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, c1 = 0, c0 = 0, c00 = 0, c10 = 0, t = 0;
  cin >> n;
  string a, b;
  cin >> a >> b;
  for (int i = 0; a[i]; i++) {
    if (a[i] == '1') c1++;
    if (a[i] == '0') c0++;
    if (a[i] == '0' && b[i] == '0') c00++;
    if (a[i] == '1' && b[i] == '0') c10++;
  }
  t += c00 * c1 + (c0 - c00) * c10;
  cout << t << endl;
}
