using System;
using System.Buffers;
using System.Globalization;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
using static System.Math;
using static Scanner;

class Solver
{
    static void Main(string[] args) {
        Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
        Solve();
        Console.Out.Flush();
    }

    static void Solve() {
        using var sc = new Scanner();
        var (N, M) = sc.Scan<long, long>();
        Console.WriteLine(Abs(N * M - 2 * (N + M) + 4));
    }
}

public struct Scanner : IDisposable
{
    const int BUFFER_SIZE = 32768, CHAR_BEGIN = 33, CHAR_END = 126, CHAR_ZERO = 48, CHAR_NINE = 57;
    static readonly Stream stdin;
    static byte[] buffer;
    int size, p;
    bool isEof;
    static Scanner() {
        stdin = Console.OpenStandardInput();
        buffer = ArrayPool<byte>.Shared.Rent(BUFFER_SIZE);
    }
    [MethodImpl(256)]
    private byte Read() {
        if (isEof) return default;
        if (p < size) return buffer[p++];
        p = 0;
        if ((size = stdin.Read(buffer, 0, BUFFER_SIZE)) > 0) return buffer[p++];
        isEof = true;
        return 0;
    }
    [MethodImpl(256)]
    private char Next() {
        byte b;
        do b = Read();
        while (!(CHAR_BEGIN <= b && b <= CHAR_END));
        return (char) b;
    }
    [MethodImpl(256)]
    private string Str() {
        var sb = new StringBuilder();
        for (var c = Next(); CHAR_BEGIN <= c && c <= CHAR_END; c = (char) Read()) {
            sb.Append(c);
        }
        return sb.ToString();
    }
    [MethodImpl(256)]
    private int Int() {
        int temp = 0;
        for (var c = Next(); CHAR_ZERO <= c && c <= CHAR_NINE; c = (char) Read()) {
            temp = temp * 10 + c - CHAR_ZERO;
        }
        return temp;
    }
    [MethodImpl(256)]
    private long Long() {
        long temp = 0;
        for (var c = Next(); CHAR_ZERO <= c && c <= CHAR_NINE; c = (char) Read()) {
            temp = temp * 10 + c - CHAR_ZERO;
        }
        return temp;
    }
    [MethodImpl(256)]
    private double Double() => double.Parse(Str(), CultureInfo.InvariantCulture);
    [MethodImpl(256)]
    public string ScanStrLine() {
        var sb = new StringBuilder();
        for (var c = Next(); c != '\n' && c != 0; c = (char) Read()) if (c != '\r') sb.Append(c);
        return sb.ToString();
    }
    [MethodImpl(256)]
    public T Scan<T>() {
        if (typeof(T) == typeof(int)) {
            var i = Int();
            return Unsafe.As<int, T>(ref i);
        }
        if (typeof(T) == typeof(long)) {
            var l = Long();
            return Unsafe.As<long, T>(ref l);
        }
        if (typeof(T) == typeof(string)) {
            var s = Str();
            return Unsafe.As<string, T>(ref s);
        }
        if (typeof(T) == typeof(double)) {
            var d = Double();
            return Unsafe.As<double, T>(ref d);
        }
        return default;
    }
    [MethodImpl(256)]
    public (T1, T2) Scan<T1, T2>() => (Scan<T1>(), Scan<T2>());
    [MethodImpl(256)]
    public (T1, T2, T3) Scan<T1, T2, T3>() => (Scan<T1>(), Scan<T2>(), Scan<T3>());
    [MethodImpl(256)]
    public (T1, T2, T3, T4) Scan<T1, T2, T3, T4>() => (Scan<T1>(), Scan<T2>(), Scan<T3>(), Scan<T4>());
    [MethodImpl(256)]
    public (T1, T2, T3, T4, T5) Scan<T1, T2, T3, T4, T5>() => (Scan<T1>(), Scan<T2>(), Scan<T3>(), Scan<T4>(), Scan<T5>());
    [MethodImpl(256)]
    public (T1, T2, T3, T4, T5, T6) Scan<T1, T2, T3, T4, T5, T6>() => (Scan<T1>(), Scan<T2>(), Scan<T3>(), Scan<T4>(), Scan<T5>(), Scan<T6>());
    [MethodImpl(256)]
    public void Dispose() { 
        ArrayPool<byte>.Shared.Return(buffer);
        buffer = null;
    }
}

Measured memory_bytes: 24056