#include <bits/stdc++.h>
using namespace std;
const unsigned long long base = 100000007;
const int INF = 0x3f3f3f3f;
const long long LNF = 1e18;
const int maxn = 5e5 + 20;
const int maxm = 1e5 + 10;
const double PI = acos(-1.0);
const double eps = 1e-8;
const int dx[] = {-1, 1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};
int dir[4][2] = {{0, 1}, {0, -1}, {-1, 0}, {1, 0}};
const int mon[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int monn[] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int n;
long long ans = 0;
char a[100005], b[100005];
int main() {
  while (~scanf("%d%s%s", &n, a + 1, b + 1)) {
    ans = 0;
    long long c1 = 0, c2 = 0, c3 = 0, c0 = 0;
    for (int i = 1; i <= n; i++) {
      if (a[i] == '0' && b[i] == '0') c0++;
      if (a[i] == '1' && b[i] == '1') c1++;
      if (a[i] == '1' && b[i] == '0') c2++;
      if (a[i] == '0' && b[i] == '1') c3++;
    }
    cout << c0 * (c1 + c2) + c2 * c3 << endl;
  }
  return 0;
}
