You are given a matrix which contains only and . Furthermore, there are exactly two in every column of this matrix. Calculate the rank of this matrix.
A *rank* of a matrix is a maximum number such that there exist a set of linearly independent rows. A set \{v_1, \ldots, v_k\} is called *linearly independent* if and only if for any real numbers a_1, \ldots, a_k such that a_1^2 + \ldots + a_k^2 \neq 0 the inequality a_1 \cdot v_1 + \ldots + a_k \cdot v_k \neq 0 holds.
For the rows, we assume the use of the standard rules of multiplication by a scalar and addition:
"' a (u(1), ..., u(m)) = (au(1), ..., au(m)),
(u(1), ..., u(m)) + (v(1), ..., v(m)) = (u(1) + v(1), ..., u(m) + v(m)). "'
A zero row is 0 = (0, \ldots, 0).
The first line contains two integers and (2 \le n \le 2 \cdot 10^5, 1 \le m \le 2 \cdot 10^5): the number of rows and columns in the matrix. Next lines each contain two integers and (1 \le r \le n, 1 \le c \le m) specifying the position of a in the matrix. Here is the row and is the column. Any cell which was not mentioned in this list contains a zero. It is guaranteed that all pairs (, ) will be distinct and that there will be exactly two in each column of the matrix.
Print the only number: the rank of the given matrix.

Example 1