#include <bits/stdc++.h>
using namespace std;
long long n, ling, ly, yl, yi;
string s1, s2;
int main() {
  cin >> n;
  cin >> s1;
  cin >> s2;
  for (int i = 0; i < n; i++) {
    if (s1[i] == '0' && s2[i] == '0') ling++;
    if (s1[i] == '0' && s2[i] == '1') ly++;
    if (s1[i] == '1' && s2[i] == '0') yl++;
    if (s1[i] == '1' && s2[i] == '1') yi++;
  }
  cout << yl * ling + yl * ly + yi * ling;
  return 0;
}
