#include <bits/stdc++.h>
using namespace std;
typedef struct line {
  int lpos;
  int rpos;
} Line;
int main(void) {
  char s[500050];
  char s1[500050];
  int n;
  long long int zero_count = 0;
  long long int one_count = 0;
  long long int sum = 0;
  cin >> n;
  cin >> s;
  cin >> s1;
  for (int i = 0; i < strlen(s); i++) {
    if (s[i] == '0')
      zero_count++;
    else
      one_count++;
  }
  for (int i = 0; i < strlen(s); i++) {
    if (s[i] == '0' && s1[i] == '0') {
      sum += one_count;
      zero_count--;
    } else if (s[i] == '1' && s1[i] == '0') {
      sum += zero_count;
      one_count--;
    }
  }
  std::cout << sum << std::endl;
  return 0;
}
