#include <bits/stdc++.h>
using namespace std;
inline void prankami() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
int main() {
  prankami();
  long long int n, zero = 0, one = 0;
  string a, b;
  cin >> n;
  char c;
  for (int i = 0; i < n; i++) {
    cin >> c;
    if (c == '0')
      zero++;
    else
      one++;
    a.push_back(c);
  }
  cin >> b;
  long long int counter = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == '0' && b[i] == '0')
      counter += one, zero--;
    else if (a[i] == '1' && b[i] == '0')
      counter += zero, one--;
  }
  cout << counter;
  return 0;
}
