#include <bits/stdc++.h>
using namespace std;
const long long MAX = 100005;
const long long mod = 1000000007;
const double PI = 2 * acos(0.0);
const double EPS = 0.00000000001;
int main() {
  long long n;
  cin >> n;
  string a, b;
  cin >> a >> b;
  long long OO = 0, II = 0, IO = 0, OI = 0;
  for (long long i = 0; i < n; i++) {
    if (a[i] == '1' and b[i] == '1')
      II++;
    else if (a[i] == '0' and b[i] == '0')
      OO++;
    else if (a[i] == '1' and b[i] == '0')
      IO++;
    else if (a[i] == '0' and b[i] == '1')
      OI++;
  }
  long long ans = (OO * II) + (OI * IO) + (OO * IO);
  cout << ans << endl;
  return 0;
}
