#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  string a;
  string b;
  long long int count1 = 0, count0 = 0;
  long long int cou0 = 0, cou1 = 0;
  char x;
  for (long long int i = 0; i < n; i++) {
    cin >> x;
    if (x == '1')
      count1++;
    else
      count0++;
    a += x;
  }
  for (long long int i = 0; i < n; i++) {
    cin >> x;
    if (x == '0') {
      if (a[i] == '0')
        cou0++;
      else
        cou1++;
    }
    b += x;
  }
  long long int ans;
  ans = cou0 * count1 + cou1 * (count0 - cou0);
  cout << ans << endl;
  return 0;
}
