The legendary Farmer John is throwing a huge party, and animals from all over the world are hanging out at his house. His guests are hungry, so he instructs his cow Bessie to bring out the snacks! Moo!

There are n snacks flavors, numbered with integers 1, 2, …, n. Bessie has n snacks, one snack of each flavor. Every guest has exactly two favorite flavors. The procedure for eating snacks will go as follows:

  * First, Bessie will line up the guests in some way. 
  * Then in this order, guests will approach the snacks one by one. 
  * Each guest in their turn will eat all remaining snacks of their favorite flavor. In case no favorite flavors are present when a guest goes up, they become very sad. 



Help Bessie to minimize the number of sad guests by lining the guests in an optimal way.

Input

The first line contains integers n and k (2 ≤ n ≤ 10^5, 1 ≤ k ≤ 10^5), the number of snacks and the number of guests. 

The i-th of the following k lines contains two integers x_i and y_i (1 ≤ x_i, y_i ≤ n, x_i ≠ y_i), favorite snack flavors of the i-th guest.

Output

Output one integer, the smallest possible number of sad guests.

Examples

Input


5 4
1 2
4 3
1 4
3 4


Output


1


Input


6 5
2 3
2 1
3 4
6 5
4 5


Output


0

Note

In the first example, Bessie can order the guests like this: 3, 1, 2, 4. Guest 3 goes first and eats snacks 1 and 4. Then the guest 1 goes and eats the snack 2 only, because the snack 1 has already been eaten. Similarly, the guest 2 goes up and eats the snack 3 only. All the snacks are gone, so the guest 4 will be sad. 

In the second example, one optimal ordering is 2, 1, 3, 5, 4. All the guests will be satisfied.
import os, sys
from io import IOBase, BytesIO
py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange
BUFSIZE = 8192
class FastIO(BytesIO):
    newlines = 0
 
    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = 'x' in file.mode or 'w' in file.mode
        self.write = super(FastIO, self).write if self.writable else None
 
    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
        return s
 
    def read(self):
        while self._fill(): pass
        return super(FastIO,self).read()
 
    def readline(self):
        while self.newlines == 0:
            s = self._fill(); self.newlines = s.count(b'\n') + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s:self.buffer.write(s.encode('ascii'))
            self.read = lambda:self.buffer.read().decode('ascii')
            self.readline = lambda:self.buffer.readline().decode('ascii')
 
 
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')
 
# Cout implemented in Python
import sys
class ostream:
    def __lshift__(self,a):
        sys.stdout.write(str(a))
        return self
cout = ostream()
endl = '\n'

def get_input(a=str):
    return a(input())

def get_int_input():
    return get_input(int)

def get_input_arr(a):
    return list(map(a, input().split()))

def get_int_input_arr():
    return get_input_arr(int)


from collections import defaultdict


class DSU:
    def __init__(
        self, N: int, has_meta: bool = False, meta_combine=None, default_meta_func=None
    ) -> None:

        self._dsu = [0] * N
        self._parent = [x for x in range(N)]
        self._size = [1 for _ in range(N)]
        self._has_meta = has_meta
        if self._has_meta:
            self._meta_arr = [default_meta_func(x) for x in range(N)]
            self._meta_combine_func = meta_combine

    def find_set(self, ele: int) -> int:
        if self._parent[ele] == ele:
            return ele
        self._parent[ele] = self.find_set(self._parent[ele])
        return self._parent[ele]

    def get_represtatives_meta(self, ele: int):
        if not self._has_meta:
            return None
        return self._meta_arr[self.find_set(ele)]

    def get_ele_size(self, ele: int):
        return self._size[self.find_set(ele)]

    def get_ele_meta(self, ele: int):
        if not self._has_meta:
            return None
        return self._meta_arr[ele]

    def get_parent_set(self):
        st = set()
        for i in self._parent:
            if self._parent[i] == i:
                st.add(i)
        return st

    def union_set(self, ele1, ele2):
        # if already of same set, return (False, set_meta)
        p1 = self.find_set(ele1)
        p2 = self.find_set(ele2)
        if p1 == p2:
            return False, self.get_ele_meta(p1)

        if self._size[p1] < self._size[p2]:
            p1, p2 = p2, p1
        self._parent[p2] = p1
        self._size[p1] += self._size[p2]
        if self._has_meta:
            self._meta_arr[p1] = self._meta_combine_func(
                self._meta_arr[p1], self._meta_arr[p2]
            )
        return True, self.get_ele_meta(p1)



def solve():
    

    n, k = get_int_input_arr()

    dsu = DSU(n + 1)

    for _ in range(k):
        v1, v2 = get_int_input_arr()

        dsu.union_set(v1, v2)


    st = 0
    
    parent_set = dsu.get_parent_set()

    for parent in parent_set:
        st += dsu._size[parent] - 1

    # st = sum(map(lambda x: x - 1, c_set_size))

    cout<<k - st<<endl



def main():
    solve()


if __name__ == "__main__":
    main()