def solve():

  c = list(map(int, input().split(' ')))

  if c[0] >= 3 and c[1] >= 3:

    return (c[0] - 2) * (c[1] - 2)

  if c[0] == 1 or c[1] == 1:

    if c[0] == 1 and c[1] == 1:

      return 1

    else:

      return max(max(c) - 2, 0)

  return 0



print((solve()))
j = list(map(int, input().split()))

counter = 0

j.sort()



if (j[0] >= 3):

  print(((j[0] - 2) * (j[1] - 2)))

elif (j[0] == 2):

  print((0))

elif (j[0] == 1):

  if j[1] == 1:

    print((1))

  else:

    print((j[1] - 2))
def solve():
    c = list(map(int, input().split(" ")))
    if c[0] >= 3 and c[1] >= 3:
        return (c[0] - 2) * (c[1] - 2)
    if c[0] == 1 or c[1] == 1:
        if c[0] == 1 and c[1] == 1:
            return 1
        else:
            return max(max(c) - 2, 0)
    return 0


print((solve()))

j = list(map(int, input().split()))
counter = 0
j.sort()
if j[0] >= 3:
    print(((j[0] - 2) * (j[1] - 2)))
elif j[0] == 2:
    print((0))
elif j[0] == 1:
    if j[1] == 1:
        print((1))
    else:
        print((j[1] - 2))

-def solve(): -    c = list(map(int, input().split(" "))) -    if c[0] >= 3 and c[1] >= 3: -        return (c[0] - 2) * (c[1] - 2) -    if c[0] == 1 or c[1] == 1: -        if c[0] == 1 and c[1] == 1: -            return 1 -        else: -            return max(max(c) - 2, 0) -    return 0 - - -print((solve())) +j = list(map(int, input().split())) +counter = 0 +j.sort() +if j[0] >= 3: +    print(((j[0] - 2) * (j[1] - 2))) +elif j[0] == 2: +    print((0)) +elif j[0] == 1: +    if j[1] == 1: +        print((1)) +    else: +        print((j[1] - 2))