#include <bits/stdc++.h>
using namespace std;
void Draganov47() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  Draganov47();
  int n;
  cin >> n;
  string a, b;
  cin >> a >> b;
  long long ans = 0;
  long long cnt0 = 0, cnt1 = 0, cnt10 = 0, cnt00 = 0;
  for (int i = 0; i < a.size(); i++) {
    if (a[i] == '0') {
      cnt0++;
    }
    if (a[i] == '1') {
      cnt1++;
    }
    if (a[i] == '0' && b[i] == '0') {
      cnt00++;
    }
    if (a[i] == '1' && b[i] == '0') {
      cnt10++;
    }
  }
  ans = cnt00 * cnt1 + cnt10 * cnt0 - cnt10 * cnt00;
  cout << ans;
  return 0;
}
