#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i;
  cin >> n;
  long long w = 0, x = 0, y = 0, z = 0;
  string p, q;
  cin >> p >> q;
  for (i = 0; i < n; i++) {
    if (p[i] == '1' and q[i] == '0')
      w++;
    else if (p[i] == '1' and q[i] == '1')
      x++;
    else if (p[i] == '0' and q[i] == '0')
      y++;
    else
      z++;
  }
  cout << w * y + w * z + x * y;
  return 0;
}
