#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, a[100005], b[100005], rec[100005];
  cin >> n;
  string s1, s2;
  cin >> s1 >> s2;
  long long int n0 = 0, n1 = 0, n2 = 0, n3 = 0;
  for (i = 0; i < n; i++) {
    if (s1[i] == '0')
      a[i] = 0;
    else
      a[i] = 1;
  }
  for (i = 0; i < n; i++) {
    if (s2[i] == '0')
      b[i] = 0;
    else
      b[i] = 1;
  }
  for (i = 0; i < n; i++) {
    if (a[i] == b[i] && a[i] == 0)
      n0++;
    else if (a[i] == b[i] && a[i] == 1)
      n3++;
    else if (a[i] == 1 && b[i] == 0)
      n2++;
    else
      n1++;
  }
  long long int ans = 0;
  ans = (n0 * n2) + (n0 * n3);
  ans += (n1 * n2);
  cout << ans << endl;
  return 0;
}
