Old man and chessboard#9064

Old man and chessboard

1 second
128 megabytes
Very easy

Kratos has travelled to many different places during his journey. So, today he wandered into a small village, where he was sheltered by a gray-haired old man, fed and gave a place for an overnight stay. Instead, the old man asked only one thing - to make a chessboard for him, because he loves this game so much.

The old man has white and black squares 1 \times 1, out of which he wants to make not an ordinary board 8 \times 8, but the largest possible, which firstly will be square, and secondly will have a chessboard coloring, that is, where any two cells adjacent by side will be of different colors (while the corner cells can be either white or black, in contrast to the usual chessboard). Kratos did not quite understand why the old man needed such a board, but did not argue, and set to work. However, our titan has very bad mathematics, so finding the length of the side of the resulting square turned out to be an impossible task for him, and he turned to you for help. Help him — find the maximum length of the side of a chessboard, which can be made up of existing squares.

Input

Two integers and m~(0 \le n, m \le 10^9) — the number of white and black squares respectively. It is guaranteed that n + m > 0.

Output

Print the length of the side of the maximum possible square having a chessboard coloring, which can be made up of the old man's squares. You do not need to use all squares.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading