#include <bits/stdc++.h>
const int MAXN = 100000 + 10;
const long long MOD = 998244353;
const int MAX = 1000000000;
const int INF = 0x7fffffff;
using namespace std;
int n;
char a[MAXN], b[MAXN];
int main() {
  scanf("%d", &n);
  scanf("%s", a);
  scanf("%s", b);
  int t[2] = {0, 0}, p[2] = {0, 0};
  long long Ans = 0ll;
  for (int i = 0; i < n; i++) {
    if (b[i] != '1') {
      if (a[i] == '0')
        Ans += (long long)t[1];
      else
        Ans += (long long)t[0];
      p[a[i] - '0']++;
    } else {
      if (a[i] == '0')
        Ans += (long long)p[1];
      else
        Ans += (long long)p[0];
    }
    t[a[i] - '0']++;
  }
  printf("%lld", Ans);
  return 0;
}
