#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
char a[MAXN], b[MAXN];
int n, now, sum0, sum1;
long long ans;
int main() {
  scanf("%d", &n);
  scanf("%s%s", a + 1, b + 1);
  for (int i = 1; i <= n; i++)
    if (a[i] == '1') now++;
  for (int i = 1; i <= n; i++)
    if (b[i] == '0') {
      if (a[i] == '0')
        sum0++, ans += now;
      else
        sum1++, ans += n - now;
    }
  printf("%I64d\n", ans - 1ll * sum0 * sum1);
}
