#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, j = 0, c1 = 0, c0 = 0;
  string a, b;
  vector<long long int> v0, v1;
  cin >> n;
  cin >> a;
  cin >> b;
  for (i = 0; i < n; i++) {
    if (b[i] == '0') {
      if (a[i] == '1')
        v1.push_back(i);
      else
        v0.push_back(i);
    }
    if (a[i] == '0')
      c0++;
    else
      c1++;
  }
  j = v0.size() * c1;
  j += (v1.size() * c0);
  j -= (v1.size() * v0.size());
  cout << j << endl;
  return 0;
}
