#include <bits/stdc++.h>
using namespace std;
char a[100 << 10];
char b[100 << 10];
int s0[100 << 10];
int s0f[100 << 10];
int s1[100 << 10];
int s1f[100 << 10];
int main() {
  int n;
  cin >> n >> a >> b;
  for (int i = 0; i < n; i++) {
    if (a[i] == '0') s0f[i + 1] = 1;
    if (a[i] == '1') s1f[i + 1] = 1;
    if (b[i] == '0')
      if (a[i] == '0')
        s0[i + 1] = 1;
      else
        s1[i + 1] = 1;
  }
  for (int i = 1; i <= n; i++) {
    s0[i] += s0[i - 1];
    s1[i] += s1[i - 1];
    s0f[i] += s0f[i - 1];
    s1f[i] += s1f[i - 1];
  }
  long long res = 0;
  for (int i = 0; i < n; i++)
    if (a[i] == '0') {
      if (b[i] == '0')
        res += s1f[i];
      else
        res += s1[i];
    } else {
      if (b[i] == '0')
        res += s0f[i];
      else
        res += s0[i];
    }
  cout << res << endl;
  return 0;
}
