#include <bits/stdc++.h>
using namespace std;
struct node {
  int x;
  int i;
  node(int x, int i) : x(x), i(i) {}
  bool operator<(const node &rhs) const {
    if (x == rhs.x) return i < rhs.i;
    return x > rhs.x;
  }
};
vector<node> v;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string a, b;
  cin >> a >> b;
  string c = a;
  long long ans;
  long long k1, k2;
  ans = k1 = k2 = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == '1') k1++;
    if (a[i] == '1' && b[i] == '0') k2++;
  }
  for (int i = 0; i < n; i++) {
    if (a[i] == '0' && b[i] == '0') {
      ans += k1;
    } else if (a[i] == '0' && b[i] == '1') {
      ans += k2;
    }
  }
  cout << ans << endl;
}
