#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  string s1;
  string s2;
  cin >> s1;
  cin >> s2;
  long long OO = 0, OZ = 0, ZO = 0, ZZ = 0;
  for (long long i = 0; i < n; i++) {
    if (s1[i] == '0' and s2[i] == '0')
      ZZ++;
    else if (s1[i] == '0' and s2[i] == '1')
      ZO++;
    else if (s1[i] == '1' and s2[i] == '0')
      OZ++;
    else if (s1[i] == '1' and s2[i] == '1')
      OO++;
  }
  long long ways = 0;
  long long type1 = 0;
  long long type2 = 0;
  for (long long i = 0; i < n; i++) {
    if (s2[i] == '0') {
      if (s1[i] == '0') {
        type1 += OO;
        type2 += OZ;
      } else if (s1[i] == '1') {
        type1 += ZO;
        type2 += ZZ;
      }
    }
  }
  cout << type1 + (type2 / 2);
}
