#include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll dp[2][2];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  string a, b;
  int n;
  cin >> n;
  cin >> a >> b;
  ll res = 0;
  for (int i = 0; i < n; ++i) {
    int x1 = a[i] - '0';
    int y1 = b[i] - '0';
    for (int x = 0; x < 2; ++x) {
      for (int y = 0; y < 2; ++y) {
        if ((x1 | y1) == (x | y1) && (x | y) == (x1 | y)) {
        } else {
          res += dp[x][y];
        }
      }
    }
    ++dp[x1][y1];
  }
  cout << res << '\n';
}
