import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons, std.bigint;

void main() {
    auto t = readln.split.to!(BigInt[]);
    if (t == [1,1]) {
        writeln(1);
        return;
    }
    if (t[0] == 1) {
        writeln(t[1]-2);
        return;
    }
    writeln((t[0]-2)*(t[1]-2));
}

