#include <bits/stdc++.h>
using namespace std;
const int MN = 100005, inf = 1000000005, MOD = 1000000007;
const long long INF = 1000000000000000005LL;
char A[MN], B[MN];
int main() {
  int n;
  int ileChce0 = 0, ileChce1 = 0, ile0 = 0, ile1 = 0;
  long long res = 0LL;
  scanf("%d", &n);
  scanf("%s%s", A, B);
  for (int i = 0; i < n; ++i) {
    if (B[i] == '1') {
      if (A[i] == '1')
        res += ileChce1;
      else
        res += ileChce0;
    } else {
      if (A[i] == '0') {
        res += ile1;
        ++ileChce1;
      } else {
        res += ile0;
        ++ileChce0;
      }
    }
    if (A[i] == '0')
      ++ile0;
    else
      ++ile1;
  }
  printf("%lld", res);
}
