eolymp
bolt
Try our new interface for solving problems
Problems

Masha - chocolate, and Misha - bagel...

Masha - chocolate, and Misha - bagel...

\includegraphics{https://static.e-olymp.com/content/3e/3e7c396b76446a7304755e2202f1a08cffdc4d98.gif} Masha loves chocolate, and Misha, in turn, loves bagels. Misha and came up with a game in which pleasure could get both. In a game played by chocolate, which has the form of rectangular tiles, consisting of \textbf{W} segments in horizontal and vertical \textbf{H} cloves. Masha always goes first. For one course are allowed to break a chocolate bar, or any part thereof, received after the first and subsequent moves into \textbf{2} parts. Those who are in their course can obtain a minimal slice, the size of \textbf{1}x\textbf{1}, is won, and him getting all the chocolate, and the loser - a bagel. If Mary wins, she happily says "\textit{Masha - chocolate!}", and Misha with no less joy continues its phrase "\textit{And Misha - a bagel!}", but if Mike wins, no one speaks. Your task is to determine how many times the game will be pleased with its outcome and Masha and Misha, provided that initially they did not play on bagels, and the chocolate, and each adheres to play an optimal strategy. \InputFile The input data consist of several test cases, each of which is located on a separate line and contains two numbers: the size of a regular candy bar \textbf{W} and \textbf{H} (\textbf{2} ≤ \textbf{W}, \textbf{H} ≤ \textbf{200}). Input data ending line containing two zeros, and this line is not processed. \OutputFile Derive a single number - how many times will be spoken and cheerful Machina and Mishina phrases.
Time limit 1 second
Memory limit 64 MiB
Input example #1
2 2
3 2
4 2
0 0
Output example #1
1

Example description: In the first two wins Misha, in the third - Masha. Accordingly, the joyous phrase will be spoken only once.

Source Team Cup Ukraine 2011 - schoolchildren - Round 1