Chess Snipers#3444

Chess Snipers

0,1 secondi
64 megabyte
Molto facile

In response to the intensifying situation on the first and third fronts of the chessboard, which consists of n \times m squares, the commander-in-chief of the white army has decided to deploy a new combat unit: the chess sniper.

A chess sniper is a piece that attacks in one fixed direction—either forward, backward, left, or right—once placed on a square of the board. Before these snipers can be deployed in battle, it is essential to determine the maximum number of such pieces that can be placed on an empty chessboard of size n \times m without any of them attacking each other.

Input

The first line of the input contains two integers and (1 \le n, m \le 1000).

Output

Output a single number on the first line, representing the maximum number of snipers that can be placed on the board without them attacking each other.

Esempi

Esempio 1

Loading
Loading