#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
const int maxn = 1e5 + 50;
const int INF = 0xffffff;
long long n;
char s1[maxn], s2[maxn];
int main() {
  cin >> n;
  scanf("%s", s1);
  scanf("%s", s2);
  long long cnt1 = 0, cnt0 = 0;
  long long cnt3 = 0, cnt4 = 0;
  for (int i = 0; i < n; ++i) {
    if (s1[i] == '0') cnt0++;
    if (s1[i] == '1') cnt1++;
    if (s2[i] == '0' && s1[i] == '0') cnt3++;
    if (s2[i] == '0' && s1[i] == '1') cnt4++;
  }
  long long ans = 0;
  ans = cnt3 * cnt1 + cnt4 * (cnt0 - cnt3);
  cout << ans;
  return 0;
}
