#include <bits/stdc++.h>   using namespace std;   string a, b;   int main() {     int n;     while (cin >> n) {       cin >> a >> b;       long long ans = 0;       long long x = 0, y = 0, p = 0, q = 0;       for (int i = 0; i < n; i++)         if (b[i] ==  1 ) a[i] ==  0  ? x++ : y++;       for (int i = 0; i < n; i++)         if (b[i] ==  0 ) a[i] ==  0  ? p++ : q++;       for (int i = 0; i < n; i++)         if (b[i] ==  0 ) a[i] ==  0  ? ans += y : ans += x;       ans += (long long)p * q;       cout << ans << endl;     }     return 0;   }   