#include <bits/stdc++.h>
using namespace std;
long long n, cnt[5], res;
string a, b;
int main() {
  cin >> n;
  cin >> a >> b;
  for (int i = 0; i < n; ++i) ++cnt[a[i] - '0'];
  for (int i = 0; i < n; ++i) {
    if (b[i] == '0') {
      if (a[i] == '0')
        res += cnt[1];
      else
        res += cnt[0];
      --cnt[a[i] - '0'];
    }
  }
  cout << res;
}
