#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
char a[maxn];
char b[maxn];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  long long cnt = 0;
  long long cnt2 = 0;
  long long cnt3 = 0;
  long long cnt4 = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == '1' && b[i] == '0') cnt++;
    if (a[i] == '0' && b[i] == '0') cnt2++;
    if (a[i] == '0' && b[i] == '1') cnt3++;
    if (a[i] == '1' && b[i] == '1') cnt4++;
  }
  long long ans = cnt * cnt3 + cnt * cnt2 + cnt2 * cnt4;
  cout << ans << endl;
  return 0;
}
