#695. Darkness I

Darkness I

Description

Princess Celestia, is an Alicorn pony, the former co-ruler of Equestria alongside her younger sister Princess Luna. Princess Celestia raises the sun and governs Equestria, while Princess Luna raises the moon and oversees the realm of dreams.

In early days, Luna felt overshadowed and ignored by the ponies of Equestria, who slept through her beautiful night sky. These negative emotions festered and eventually led her to be consumed by the darkness and power of the mythical creature known as Nightmare Moon.

The darkness was spreading, and could be transformed into the following model:

In an n×mn\times m white 2D grid, there are several black grid points.

Every second, all white points that are 4-neighbors of at least two black points will turn black.

What is the minimum number of black points needed to turn the entire grid black in the end?

Format

Input

The first line contains two integers, nn and mm (1n,m105)(1\le n,m\le 10^5), representing the size of the grid

Output

Output a single integer representing the minimum number of black points needed.

Samples

2 2
2

Limitation

1s, 1024KiB for each test case.