PROGRAMMING:Roller Coaster
Today, RPG girls will go to the amusement park with you and finally get on the roller coaster. However, there are only two seats in each row of the roller coaster, and there is an unwritten rule that every girl must find every boy to be her partner. However, every girl has her own ideas. For example, rabbit is only willing to be a partner with xhd or pqK, grass is only willing to be a partner with linle or LL, and Princess Snow is willing to be a partner with water prodigal or fake queer. Considering the financial problem, boss Liu decided to let only those who found partners take the roller coaster. The others, hey, hey, just stand down and watch. Smart acmer, can you help to figure out how many pairs can ride the roller coaster at most?
###Input format:
The first line of the input data is three integers K, m and N, which respectively represent the number of possible combinations, the number of girls and the number of boys. 01 < = n and m < = 500. The next K lines, each line has two numbers, respectively, indicating that the girl AI is willing to be a partner with the boy BJ. The last 0 ends the input.
###Output format:
For each group of data, output an integer to indicate the maximum number of combinations that can ride the roller coaster.
###Input example:
Here is a set of inputs. For example:
```in
6 3 3
1 1
1 2
1 3
2 1
2 3
3 1
```
###Output example:
The corresponding output is given here. For example:
```out
three
```
answer:If there is no answer, please comment
###Input format:
The first line of the input data is three integers K, m and N, which respectively represent the number of possible combinations, the number of girls and the number of boys. 0
###Output format:
For each group of data, output an integer to indicate the maximum number of combinations that can ride the roller coaster.
###Input example:
Here is a set of inputs. For example:
```in
6 3 3
1 1
1 2
1 3
2 1
2 3
3 1
```
###Output example:
The corresponding output is given here. For example:
```out
three
```
answer:If there is no answer, please comment