#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
const int mod = 1e9 + 7;
const double eps = 1e-9;
const double pi = acos(-1.0);
const int inf = 0x3f3f3f3f;
char s1[maxn], s2[maxn];
int n;
int main() {
  cin >> n;
  scanf("%s%s", s1 + 1, s2 + 1);
  long long f1 = 0, f2 = 0;
  for (int i = 1; i <= n; i++) {
    if (s1[i] == '1')
      f1++;
    else
      f2++;
  }
  long long sum = 0, c1 = 0, c2 = 0;
  for (int i = 1; i <= n; i++) {
    if (s2[i] == '0' && s1[i] == '0') {
      c1++;
    } else if (s2[i] == '0')
      c2++;
  }
  sum = c1 * f1 + c2 * (f2 - c1);
  printf("%lld\n", sum);
  return 0;
}
