J. Ginger's cow
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Ginger has a total of $$$n$$$ cows, he has $$$m$$$ old cows and $$$n-m$$$ small cows. Old cows can feed small cows, Ginger wants to pair as many cows with small cows as possible.

Ginger wants to know the maximum number of small cows that can be fed

Input

The first line contains three integers $$$m$$$ indicating the number of old cows, $$$n$$$ indicating the number of cows, $$$q$$$ indicating feeding relationship. $$$1 \le m \le n \le 100$$$, $$$1 \le q \le 10 ^ 3$$$

Next $$$q$$$ lines, each line has two strings $$$u, v$$$, representing old cows $$$u$$$ can feed small cows $$$v$$$

Output

Print the maximum number of small cows that can be fed.

Example
Input
5 10 10
A G
A H
B F
B I
B J
C G
C H
D G
D H
E J
Output
4