#include <bits/stdc++.h>
using namespace std;
int n, x1, x0;
string a, b;
int x00, x10;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> n >> a >> b;
  for (int i = 0; i < n; i++) {
    if (a[i] == '1') x1++;
    if (a[i] == '0') x0++;
    if (a[i] == '0' && b[i] == '0') x00++;
    if (a[i] == '1' && b[i] == '0') x10++;
  }
  cout << 1LL * x00 * x1 + 1LL * x10 * x0 - 1LL * x00 * x10;
  return 0;
}
