#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string a, b;
  cin >> a >> b;
  char a1[4] = {'0', '0', '1', '1'};
  char b1[4] = {'0', '1', '0', '1'};
  long long int sum[4] = {0};
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 4; j++) {
      if (a1[j] == a[i] && b1[j] == b[i]) sum[j]++;
    }
  }
  cout << sum[0] * sum[2] + sum[0] * sum[3] + sum[1] * sum[2] << endl;
  return 0;
}
