#include <bits/stdc++.h>
using namespace std;
inline int read();
inline void swap(int &a, int &b) {
  int temp = a;
  a = b;
  b = temp;
}
int n;
string s;
int x[100010], y[100010];
long long a, b, c, d;
long long ans;
int main() {
  cin >> n;
  cin >> s;
  for (int i = 1; i <= n; i++) x[i] = (s[i - 1] == '1');
  cin >> s;
  for (int i = 1; i <= n; i++) y[i] = (s[i - 1] == '1');
  for (int i = 1; i <= n; i++) {
    if (x[i] == 0 && y[i] == 0)
      a++;
    else if (x[i] == 1 && y[i] == 0)
      b++;
    else if (x[i] == 1 && y[i] == 1)
      c++;
    else if (x[i] == 0 && y[i] == 1)
      d++;
  }
  ans = a * (b + c) + b * d;
  cout << ans << endl;
  return 0;
}
