#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
long long n, m, a, b, c, d, ans;
char s[maxn], e[maxn];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf(" %c", &s[i]);
  }
  for (int i = 1; i <= n; i++) {
    scanf(" %c", &e[i]);
    if (s[i] == '0' && e[i] == '0')
      a += 1;
    else if (s[i] == '0' && e[i] == '1')
      b += 1;
    else if (s[i] == '1' && e[i] == '0')
      c += 1;
    else
      d += 1;
  }
  for (int i = 1; i <= n; i++) {
    if (s[i] == '0' && e[i] == '0') ans += c + d;
    if (s[i] == '1' && e[i] == '0') ans += b;
  }
  printf("%lld\n", ans);
}
