#include <bits/stdc++.h>
using namespace std;
const int maxn = 102400;
long long n, ans, c00, c01, c10, c11;
string a, b;
int main() {
  cin >> n >> a >> b;
  for (int i = 0; i < n; i++) {
    if (a[i] == '0' && b[i] == '0')
      c00++;
    else if (a[i] == '0' && b[i] == '1')
      c01++;
    else if (a[i] == '1' && b[i] == '0')
      c10++;
    else if (a[i] == '1' && b[i] == '1')
      c11++;
  }
  for (int i = 0; i < n; i++) {
    if (a[i] == '0' && b[i] == '0')
      ans += (c10 + c11);
    else if (a[i] == '0' && b[i] == '1')
      ans += c10;
    else if (a[i] == '1' && b[i] == '0')
      ans += (c00 + c01);
    else if (a[i] == '1' && b[i] == '1')
      ans += c00;
  }
  cout << ans / 2 << endl;
}
