#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, c_0 = 0, c_1 = 0, cnt1 = 0, cnt0 = 0, ans = 0;
  string a, b;
  cin >> n;
  cin >> a >> b;
  for (long long i = 0; i < n; i++) {
    if (b[i] == '0' && a[i] == '0')
      c_0++;
    else if (b[i] == '0' && a[i] == '1')
      c_1++;
    else if (a[i] == '1')
      cnt1++;
    else
      cnt0++;
  }
  ans += c_1 * (cnt0);
  ans += c_0 * cnt1;
  ans += c_0 * c_1;
  cout << ans;
  return 0;
}
