#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, c = 0, d = 0, e = 0, f = 0;
  cin >> n;
  string a, b;
  cin >> a >> b;
  for (int i = 0; i < n; i++) {
    if (a[i] == '1') c++;
    if ((a[i] == '0') && (b[i] == '0')) d++;
    if (a[i] == '0' and (b[i] == '1')) e++;
    if ((a[i] == '1') and (b[i] == '0')) f++;
  }
  cout << (c * d) + (e * f);
}
