#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
template <class T>
void dbg(const char* xn, T x) {
  if (0) cout << xn << ": " << x << "\n";
}
template <class T, class... TA>
void dbg(const char* xn, T x, TA... t) {
  while (*xn != ',')
    if (0) cout << *xn++;
  if (0) cout << ": " << x << ",";
  dbg(xn + 1, t...);
}
template <class T>
inline bool upd_max(T& x, T y) {
  return y > x ? x = y, true : false;
}
template <class T>
inline bool upd_min(T& x, T y) {
  return y < x ? x = y, true : false;
}
const int N = 1000007;
long long n, m1 = 0, m0 = 0, n1 = 0, n0 = 0;
string A, B;
void solve() {
  cin >> n;
  cin >> A;
  A = '#' + A;
  cin >> B;
  B = '#' + B;
  for (long long i = 1; i <= (n); ++i) {
    if (A[i] == '1')
      ++n1;
    else if (A[i] == '0')
      ++n0;
    if (A[i] == '1' && B[i] == '0') ++m1;
    if (A[i] == '0' && B[i] == '0') ++m0;
  }
  cout << m1 * n0 + m0 * n1 - m1 * m0;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(10);
  solve();
  return 0;
}
