Kakuma's favorite game is the picture matching game, which is played using cards with patterns on them. There are 26 different patterns in this game, and you use 2 cards with each pattern on them, for a total of 52 cards.
The first step is to place all the cards on the table so that their patterns are not visible. Then you choose two cards from them and remove them from the table if they have the same picture. If they are different, the two cards are returned to the table with their picture hidden. The game ends when all the cards are removed from the table.
Kakuma decided to teach his sister, Yae, this picture matching game. However, 52 cards are too difficult for her, so he decided to choose 4 cards to make a mini picture matching game. When the rules of the mini picture matching game are the same as those of the picture matching game, are the cards Kakuma chose the right combination to finish the game?
Create a program to determine if the mini picture matching game can be finished with four given cards. We assume that the 26 different pictures are represented by integers from 1 to 26.
Input is given in the following format.
$a_1$ $a_2$ $a_3$ $a_4$
Four integers $a_i$ ($1 \leq a_i \leq 26$) that represent the type of pictures of the four cards are given in a line. Note that no more than three of the same value can be given.
Output 1 if the mini picture matching game can be completed, 0 if it cannot in a line.
1 2 1 2
1
5 7 5 8
0