#include <bits/stdc++.h>
const long long inf = std::numeric_limits<long long>::max();
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  string a, b;
  cin >> a >> b;
  long long x1, x2, y1, y2;
  x1 = x2 = y1 = y2 = 0;
  for (auto i : a) {
    if (i == '0') {
      x1++;
    } else {
      x2++;
    }
  }
  for (int i = 0; i < n; i++) {
    if (b[i] == '1' && a[i] == '1') {
      y1++;
    }
    if (b[i] == '1' && a[i] == '0') {
      y2++;
    }
  }
  cout << x1 * x2 - y1 * y2;
  return 0;
}
