#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string a, b;
  cin >> a;
  cin >> b;
  long long s = 0;
  long long s3 = 0, s2 = 0, s1 = 0, s4 = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == '0' && b[i] == '0') s1++;
    if (a[i] == '1' && b[i] == '0') s2++;
    if (a[i] == '0' && b[i] == '1') s3++;
    if (a[i] == '1' && b[i] == '1') s4++;
  }
  cout << s1 * s4 + s1 * s2 + s2 * s3;
}
