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