#include <bits/stdc++.h>
using namespace std;
int n;
char s1[100009], s2[100009];
long long a[2][2], ans;
int main() {
  scanf("%d\n", &n);
  scanf("%s", s1);
  scanf("%s", s2);
  for (int i = 0; i < n; i++) {
    a[s1[i] - '0'][s2[i] - '0']++;
  }
  ans = a[0][0] * a[1][1] + a[1][0] * a[0][1] + a[0][0] * a[1][0];
  printf("%lld", ans);
}
