#include <bits/stdc++.h>
using namespace std;
long long int m, nn, o, p;
int main() {
  long long int n;
  cin >> n;
  string a, b;
  cin >> a >> b;
  for (int i = 0; i < n; i++)
    if (a[i] == '0') {
      if (b[i] == '0')
        m++;
      else
        nn++;
    } else {
      if (b[i] == '0')
        o++;
      else
        p++;
    }
  cout << m * p + m * o + nn * o << endl;
}
