#include <bits/stdc++.h>
using namespace std;
void fastscan(int &number) {
  bool negative = false;
  register int c;
  number = 0;
  c = getchar();
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) number = number * 10 + c - 48;
  if (negative) number *= -1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  long long int n;
  cin >> n;
  string a, b;
  cin >> a;
  cin >> b;
  long long int ans = 0;
  vector<long long int> v;
  vector<long long int> v1;
  for (long long int i = 0; i < n; i++) {
    if (b[i] == '0') {
      v.push_back(i);
    } else {
      v1.push_back(i);
    }
  }
  long long int p = 0;
  long long int q = 0;
  long long int c = 0;
  long long int d = 0;
  for (long long int i = 0; i < v.size(); i++) {
    if (a[v[i]] == '0') {
      p++;
    } else {
      q++;
    }
  }
  for (long long int i = 0; i < v1.size(); i++) {
    if (a[v1[i]] == '0') {
      c++;
    } else {
      d++;
    }
  }
  cout << p * q + c * q + d * p;
  return 0;
}
