#include <bits/stdc++.h>
using namespace std;
long long n, k1, k2, k3, k4;
string s1, s2;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> s1 >> s2;
  for (int i = 0; i < n; i++) {
    if (s1[i] == '1' && s2[i] == '1') k1++;
    if (s1[i] == '1' && s2[i] == '0') k2++;
    if (s1[i] == '0' && s2[i] == '1') k3++;
    if (s1[i] == '0' && s2[i] == '0') k4++;
  }
  cout << k3 * k2 + k1 * k4 + k4 * k2 << endl;
  return 0;
}
