import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip;

immutable long MOD = 10^^9 + 7;

void main() {
    auto N = readln.chomp.to!int;
    auto A = readln.chomp.map!(a => a == '1').array;
    auto B = readln.chomp.map!(a => a == '1').array;

    auto cnt = new long[](4);

    foreach (i; 0..N) {
        if (!A[i] && !B[i]) {
            cnt[0] += 1;
        } else if (A[i] && !B[i]) {
            cnt[1] += 1;
        } else if (!A[i] && B[i]) {
            cnt[2] += 1;
        } else {
            cnt[3] += 1;
        }
    }

    auto ans = cnt[0] * cnt[1] + cnt[0] * cnt[3] + cnt[1] * cnt[2];
    ans.writeln;
}
