#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long ans = 0, cnt[4] = {0};
  scanf("%d", &n);
  string a, b;
  cin >> a >> b;
  for (int i = 0; i < n; i++) {
    if (a[i] == '0' && b[i] == '0') cnt[0]++;
    if (a[i] == '0' && b[i] == '1') cnt[1]++;
    if (a[i] == '1' && b[i] == '0') cnt[2]++;
    if (a[i] == '1' && b[i] == '1') cnt[3]++;
  }
  printf("%I64d\n", cnt[0] * cnt[3] + cnt[0] * cnt[2] + cnt[1] * cnt[2]);
  return 0;
}
