#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, sum = 0, i, one = 0, zero = 0;
  string stra, strb;
  cin >> n;
  cin >> stra >> strb;
  for (i = 0; stra[i]; i++) {
    if (stra[i] == '0')
      zero++;
    else
      one++;
  }
  for (i = 0; stra[i]; i++) {
    if (stra[i] == '0' && strb[i] == '0') {
      sum += one;
      zero--;
    } else if (stra[i] == '1' && strb[i] == '0') {
      sum += zero;
      one--;
    }
  }
  cout << sum << endl;
}
