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