#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string a, b;
  cin >> a >> b;
  long long int ans = 0;
  long long int c = 0, d = 0, f = 0, g = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == '1') {
      if (b[i] == '1')
        c++;
      else
        d++;
    } else {
      if (b[i] == '1')
        f++;
      else
        g++;
    }
  }
  ans += f * d;
  ans += c * g + g * d;
  cout << ans << endl;
  return 0;
}
