#include <bits/stdc++.h>
using namespace std;
char a[100010];
char b[100010];
int n;
int main() {
  scanf("%d\n", &n);
  scanf("%s", a);
  scanf("%s", b);
  int totalZero = 0;
  int totalOne = 0;
  int emptyZero = 0;
  int emptyOne = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == '0') {
      totalZero++;
      if (b[i] == '0') emptyZero++;
    } else {
      totalOne++;
      if (b[i] == '0') emptyOne++;
    }
  }
  long long total = 0;
  long long emptyTotal = 0;
  for (int i = 0; i < n; i++) {
    if (b[i] == '1') continue;
    if (a[i] == '0') {
      total = total + totalOne;
      emptyTotal = emptyTotal + emptyOne;
    } else {
      total = total + totalZero;
      emptyTotal = emptyTotal + emptyZero;
    }
  }
  long long ans = total - emptyTotal / 2;
  printf("%I64d\n", ans);
  return 0;
}
