#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool isprime(long long x) {
  if (x == 1) return false;
  if (x == 2) return true;
  for (int i = 2; i * i <= x; i++)
    if (x % i == 0) return false;
  return true;
}
int main() {
  int n;
  cin >> n;
  string a, b;
  cin >> a >> b;
  long long cnt0 = 0, cnt1 = 0, cnt11 = 0, cnt00 = 0;
  for (int i = 0; i < n; i++) {
    if (b[i] == '0') {
      if (a[i] == '1')
        cnt1++;
      else
        cnt0++;
    } else {
      if (a[i] == '1')
        cnt11++;
      else
        cnt00++;
    }
  }
  long long ans =
      ((cnt0 * (cnt11 + cnt1)) + (cnt1 * (cnt00 + cnt0))) - (cnt1 * cnt0);
  cout << ans << "\n";
}
