#include <bits/stdc++.h>
using namespace std;
inline long long gcd(long long a, long long b) {
  a = ((a) < 0 ? -(a) : (a));
  b = ((b) < 0 ? -(b) : (b));
  while (b) {
    a = a % b;
    swap(a, b);
  }
  return a;
}
const long long inf = 2147383647;
const long long mod = 1000000007;
const double pi = 2 * acos(0.0);
const double eps = 1e-9;
int main() {
  int n;
  cin >> n;
  string s1, s2;
  int a, b, c, d;
  long long ans;
  cin >> s1 >> s2;
  a = b = c = d = 0;
  ans = 0;
  for (long long i = (0); i <= (((long long)(s1).size()) - 1); ++i) {
    if (s1[i] == '0')
      a++;
    else
      b++;
  }
  for (long long i = (0); i <= (n - 1); ++i) {
    if (s2[i] == '0') {
      if (s1[i] == '0') {
        ans += b - d;
        c++;
      } else {
        ans += a - c;
        d++;
      }
    }
  }
  printf("%lld\n", ans);
  return 0;
}
