#include <bits/stdc++.h>
using namespace std;
char n1[100005], n2[100005];
int main() {
  long long n, num1 = 0, num0 = 0, ans = 0;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> n1[i];
    if (n1[i] == '1')
      num1++;
    else
      num0++;
  }
  for (long long i = 1; i <= n; i++) {
    cin >> n2[i];
  }
  for (long long i = 1; i <= n; i++) {
    if (n1[i] == '1' && n2[i] == '0') {
      ans = ans + num0;
      num1--;
    }
    if (n1[i] == '0' && n2[i] == '0') {
      ans = ans + num1;
      num0--;
    }
  }
  cout << ans;
}
