#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, one = 0, zero = 0, ans = 0;
  cin >> n;
  string a, b;
  cin >> a >> b;
  for (int i = 0; i < n; i++) {
    if (a[i] == '1')
      one++;
    else
      zero++;
  }
  if (one == 0 || zero == 0) {
    printf("0\n");
    return 0;
  }
  long long cnto = 0, cntz = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == '1' && b[i] == '0') {
      ans += zero;
      cnto++;
    } else if (a[i] == '0' && b[i] == '0') {
      ans += one;
      cntz++;
    }
  }
  ans -= (cnto * cntz);
  printf("%lld\n", ans);
}
