#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  string s, t;
  cin >> n >> s >> t;
  vector<long long> cnt(2, 0);
  for (char c : s) ++cnt[c - '0'];
  vector<long long> dp(2, 0);
  for (int i = 0; i < s.size(); ++i) dp[s[i] - '0'] += t[i] == '0';
  long long res =
      dp[0] * dp[1] + dp[0] * (cnt[1] - dp[1]) + dp[1] * (cnt[0] - dp[0]);
  cout << res << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
