#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
string a, b;
int main() {
  int n;
  cin >> n;
  cin >> a >> b;
  long long a0 = 0, a10 = 0, a01 = 0, a1 = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == b[i] && a[i] == '0') a0++;
    if (a[i] == '1') {
      a1++;
      if (b[i] == '0') a10++;
    }
    if (a[i] == '0' && b[i] == '1') a01++;
  }
  cout << a0 * a1 + a01 * a10 << endl;
  return 0;
}
