#include <bits/stdc++.h>
using namespace std;
long long int c[2][2];
char a[100010], b[100010];
int main() {
  int n;
  scanf("%d%s%s", &n, &a, &b);
  memset(c, 0x00, sizeof(c));
  for (int i = 0; i < n; i++) c[a[i] - '0'][b[i] - '0']++;
  printf("%lld\n", c[0][0] * c[1][0] + c[0][0] * c[1][1] + c[0][1] * c[1][0]);
}
