#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a[100001] = {0}, b[100001] = {0}, i, j;
  cin >> n;
  for (i = 0; i < n; i++) scanf("%1d", &a[i]);
  for (i = 0; i < n; i++) scanf("%1d", &b[i]);
  long long count = 0;
  long long cnt = 0, sum = 0, ans = 0, tot = 0;
  for (i = 0; i < n; i++) {
    if (b[i] == 0 && a[i] == 0) {
      cnt++;
      b[i] = 2;
      a[i] = 2;
    }
  }
  for (i = 0; i < n; i++) {
    if (a[i] == 1) count++;
  }
  sum = count * cnt;
  for (i = 0; i < n; i++) {
    if (b[i] == 0 && a[i] == 1) {
      ans++;
    }
  }
  for (j = 0; j < n; j++) {
    if (b[j] && !a[j]) tot++;
  }
  sum += tot * ans;
  cout << sum << endl;
  return 0;
}
