#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
const long long maxn = 1e5 + 10, M = 1e9 + 7;
long long n, cnt[2][2], ans;
char a[maxn], b[maxn];
int32_t main() {
  scanf("%lld%s%s", &n, a, b);
  for (long long i = 0; i < n; i++) {
    cnt[a[i] - '0'][b[i] - '0']++;
  }
  for (long long i = 0; i < 4; i++) {
    for (long long j = 0; j < 4; j++) {
      long long x = i;
      if (x == 2)
        x = 1;
      else if (x == 1)
        x = 2;
      if ((i | j) != (x | j)) {
        ans += cnt[i / 2][j / 2] * cnt[i % 2][j % 2];
      }
    }
  }
  printf("%lld\n", ans / 2);
}
