#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e3 + 1;
const int INF = 1e9 + 7;
long long d[2][2];
int main() {
  int N;
  cin >> N;
  string A, B;
  cin >> A >> B;
  for (int i = 0; i < N; i++) {
    d[A[i] - '0'][B[i] - '0']++;
  }
  cout << (long long)(d[0][0] * d[1][1] * 1LL + d[0][0] * d[1][0] * 1LL +
                      d[0][1] * d[1][0] * 1LL);
  return 0;
}
