#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long N;
  cin >> N;
  vector<long long> a(N), b(N);
  for (long long i = 0; i < N; ++i) {
    char X;
    cin >> X;
    a[i] = X - '0';
  }
  for (long long i = 0; i < N; ++i) {
    char X;
    cin >> X;
    b[i] = X - '0';
  }
  long long ans = 0;
  long long _11 = 0, _10 = 0, _01 = 0, _00 = 0;
  for (long long i = 0; i < N; ++i) {
    if (a[i] && b[i]) {
      ans += _00;
      ++_11;
    } else if (a[i]) {
      ans += _00;
      ans += _01;
      ++_10;
    } else if (b[i]) {
      ans += _10;
      ++_01;
    } else {
      ans += _11;
      ans += _10;
      ++_00;
    }
  }
  cout << ans << endl;
}
