#include <bits/stdc++.h>
using namespace std;
void debug(string s) { cout << s << "\n"; }
const int MAX = 2000007;
bool prime[MAX];
int sp[MAX];
void sieve() {
  for (int i = 2; i < MAX; i += 2) {
    sp[i] = 2;
  }
  for (long long i = 3; i < MAX; i += 2) {
    if (!prime[i]) {
      sp[i] = i;
      for (long long j = i; (j * i) < MAX; j += 2) {
        if (!prime[j * i]) {
          prime[j * i] = true;
          sp[j * i] = i;
        }
      }
    }
  }
}
long long GCD(long long a, long long b) {
  long long c = a % b;
  while (c != 0) {
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}
long long power(long long a, long long b) {
  long long ans = 1;
  while (b != 0) {
    if (b % 2 == 1) ans *= a;
    a *= a;
    b = b >> 1;
  }
  return ans;
}
int main() {
  long long n;
  cin >> n;
  string s1, s2;
  cin >> s1 >> s2;
  long long count1 = 0, count00 = 0, count01 = 0, count10 = 0;
  for (long long i = 0; i < n; i++) {
    if (s1[i] == '1') count1++;
    if (s1[i] == '0' && s2[i] == '0') count00++;
    if (s1[i] == '0' && s2[i] == '1') count01++;
    if (s1[i] == '1' && s2[i] == '0') count10++;
  }
  long long ans = count00 * count1 + count01 * count10;
  cout << ans;
}
