#include <bits/stdc++.h>
using namespace std;
inline void op() {}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  op();
  int n;
  cin >> n;
  string a, b;
  cin >> a >> b;
  long long int ans = 0, cnt1 = 0, cnt2 = 0, cnt3 = 0, cnt4 = 0;
  for (int i = 0; i <= n - 1; i = i + 1) {
    if (a[i] == '1' && b[i] == '0')
      cnt1++;
    else if (a[i] == '0' && b[i] == '0')
      cnt2++;
    else if (a[i] == '1' && b[i] == '1')
      cnt3++;
    else
      cnt4++;
  }
  ans += cnt1 * cnt2;
  ans += cnt2 * cnt3;
  ans += cnt4 * cnt1;
  cout << ans;
  return 0;
}
