#include <bits/stdc++.h>
using namespace std;
const int Maxn = 100005;
char A[Maxn], B[Maxn];
int a[Maxn], b[Maxn], Asum_zero, Asum_one, n;
struct query {
  int Asum_oneque;
  int Asum_zeroque;
} que;
inline void input() {
  int i;
  scanf("%d", &n);
  for (i = n; i >= 1; --i) cin >> A[i];
  for (i = n; i >= 1; --i) cin >> B[i];
  for (i = 1; i <= n; ++i) a[i] = A[n - i + 1] - '0', b[i] = B[n - i + 1] - '0';
}
inline void sum() {
  for (int i = 1; i <= n; ++i)
    if (a[i]) Asum_one++;
  Asum_zero = n - Asum_one;
}
inline void search() {
  for (int i = 1; i <= n; ++i)
    if (b[i]) {
      if (a[i])
        que.Asum_oneque++;
      else
        que.Asum_zeroque++;
    }
}
inline void output() {
  int sum_relay = que.Asum_oneque * que.Asum_zeroque;
  printf("%lld", (long long)Asum_zero * Asum_one - sum_relay);
}
int main() {
  input();
  sum();
  search();
  output();
}
