#include <bits/stdc++.h>
using namespace std;
int n;
char A[100100], B[100100];
int a, b;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  cin >> A;
  cin >> B;
  int t1 = 0, t2 = 0, t3 = 0, t4 = 0;
  for (int i = 0; i < n; i++) {
    if (A[i] == '0') t2++;
    if (A[i] == '1') t4++;
    if (B[i] == '0') {
      if (A[i] == '0') t1++;
      if (A[i] == '1') t3++;
    }
  }
  long long Ans = (long long)t1 * t4 + (long long)t2 * t3 - (long long)t1 * t3;
  cout << Ans << endl;
  return 0;
}
