#include <bits/stdc++.h>
using namespace std;
char a[100005], b[100005];
int main() {
  long long n, x = 0, y = 0, sum = 0, k = 0, h = 0;
  scanf("%lld", &n);
  scanf("%s%s", a, b);
  for (long long i = 0; i < n; i++) {
    if (a[i] == '0')
      x++;
    else if (a[i] == '1')
      y++;
  }
  for (long long i = 0; i < n; i++) {
    if (b[i] == '0') {
      if (a[i] == '1') {
        ++k;
        sum += x;
      } else {
        ++h;
        sum += y;
      }
    }
  }
  sum = sum - (h * k);
  printf("%lld\n", sum);
  return 0;
}
