#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  long long count(string& a, string& b) {
    int n = a.length();
    int cnt00 = 0;
    int cnt10 = 0;
    int cnt01 = 0;
    int cnt11 = 0;
    long long res = 0;
    for (int i = 0; i < n; ++i) {
      if (a[i] == '0') {
        if (b[i] == '0') {
          ++cnt00;
        } else {
          ++cnt01;
        }
      } else {
        if (b[i] == '0') {
          ++cnt10;
        } else {
          ++cnt11;
        }
      }
    }
    res = 1LL * cnt00 * (cnt10 + cnt11) + 1LL * cnt01 * cnt10;
    return res;
  }
};
int main(int argc, char** argv) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  string a, b;
  cin >> a >> b;
  Solution sol;
  cout << sol.count(a, b) << endl;
  return 0;
}
