#include <bits/stdc++.h>
using namespace std;
bool cmp(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first == b.first) ? (a.second > b.second) : (a.first < b.first);
}
void swap(int *a, int *b) {
  int temp = *a;
  *a = *b;
  *b = temp;
}
void findor(int a[], int b[], int c[], int n) {
  for (int i = 0; i < n; i++) {
    if (a[i] == 1 || b[i] == 1)
      c[i] = 1;
    else
      c[i] = 0;
  }
}
int main() {
  int n;
  cin >> n;
  string s1, s2;
  cin >> s1 >> s2;
  int a[100005], b[100006], c[100004];
  for (int i = 0; i < n; i++) a[i] = (int)(s1[i] - '0');
  for (int i = 0; i < n; i++) b[i] = (int)(s2[i] - '0');
  findor(a, b, c, n);
  long long cnt = 0;
  int ones = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == 1) ones++;
  }
  int zeros = n - ones;
  int tp = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == 0 && b[i] == 0) {
      cnt += (long long)ones;
      tp++;
    }
  }
  for (int i = 0; i < n; i++) {
    if (a[i] == 1 && b[i] == 0) {
      cnt += (long long)(zeros - tp);
    }
  }
  cout << cnt;
  return 0;
}
