#include <bits/stdc++.h>
using namespace std;
int n;
char a[100005];
char b[100005];
int main() {
  cin >> n;
  cin >> a;
  cin >> b;
  long long num10 = 0, num11 = 0;
  long long num00 = 0, num01 = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == '1' && b[i] == '1') num11++;
    if (a[i] == '1' && b[i] == '0') num10++;
    if (a[i] == '0' && b[i] == '1') num01++;
    if (a[i] == '0' && b[i] == '0') num00++;
  }
  long long ans = 0;
  ans = num00 * num10 + num01 * num10 + num00 * num11;
  cout << ans << endl;
  return 0;
}
