#include <bits/stdc++.h>
using namespace std;
int a[55][55];
int main() {
  int n;
  cin >> n;
  string s, t;
  cin >> s >> t;
  int zr = 0, onezr = 0, zrone = 0, one = 0;
  for (int i = 0; i < (int)s.size(); ++i) {
    if (s[i] == '0' and t[i] == '0') zr += 1;
    if (s[i] == '0' and t[i] == '1') zrone += 1;
    if (s[i] == '1' and t[i] == '0') onezr += 1;
    if (s[i] == '1') one += 1;
  }
  long long ans = (one * 1LL * zr) + (zrone * 1LL * onezr);
  cout << ans << endl;
  return 0;
}
