#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string a, b;
  cin >> a;
  cin >> b;
  int cnt0 = 0, cnt1 = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == '1' && b[i] != '0')
      cnt1++;
    else if (a[i] == '0')
      cnt0++;
  }
  long long int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == '1' && b[i] == '0')
      cnt += cnt0;
    else if (a[i] == '0' && b[i] == '0')
      cnt += cnt1;
  }
  cout << cnt << endl;
}
