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 java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;
import java.util.StringTokenizer;


import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader sc = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, sc, out);
        out.close();
    }

    static class Task {
    	
    	public int find(int x,int[] pre) {
    		int temp=x;
    		while(temp!=pre[temp])
    			temp=pre[temp];
    		int i=x,j;
    		while(i!=temp) {
    			j=pre[i];
    			pre[i]=temp;
    			i=j;
    		}
    		return temp;
    	}
    	
    	public void join(int x,int y,int[] pre) {
    		int a=find(x,pre);
    		int b=find(y,pre);
    		if(a!=b) {
    			pre[a]=b;
    		}
    	}
    	
        public void solve(int testNumber, InputReader sc, PrintWriter out) throws IOException {
        	int n=sc.nextInt();
        	int k=sc.nextInt();
        	int[] d=new int[n+1];
        	int[] pre=new int[n+1];
        	
        	for(int i=1;i<=n;i++)
        		pre[i]=i;
        	for(int i=0;i<k;i++) {
        		int u=sc.nextInt();
        		int v=sc.nextInt();
        		join(u,v,pre);
        	}
        	int ans=k;
        	int[] cnt=new int[n+1];
        	for(int i=1;i<=n;i++)
        		cnt[find(i,pre)]++;
        	for(int i=1;i<=n;i++) {
        		if(cnt[i]!=0) {
        			ans-=(cnt[i]-1);
        		}
        	}
        	out.println(ans);
        }

    }
    

    static class InputReader {
        private InputStreamReader reader;
        private char[] buf;
        private int len, now;
     
        public InputReader(InputStream stream) {
            reader = new InputStreamReader(stream);
            buf = new char[1024];
            len = 0;
            now = 0;
        }
     
        public String next() throws IOException {
            if (!hasNext()) throw new NullPointerException();
            StringBuilder sb = new StringBuilder();
            while (!isSpaceChar(buf[now])) {
                sb.append(buf[now]);
                if (!move()) break;
            }
            return sb.toString();
        }
     
        public int nextInt() throws IOException {
            if (!hasNext()) throw new NullPointerException();
            boolean x = false;
            if (buf[now] == '-') {
                x = true;
                if (!move()) throw new NumberFormatException();
            }
            int ans = 0;
            while (!isSpaceChar(buf[now])) {
                if (isNum(buf[now])) ans = ans * 10 + buf[now] - '0';
                else throw new NumberFormatException();
                if (!move()) break;
            }
            return (x ? -1 : 1) * ans;
        }
     
        public String nextLine() throws IOException {
            if (!hasNextLine()) throw new NullPointerException();
            StringBuilder sb = new StringBuilder();
            while (buf[now] != '\n') {
                sb.append(buf[now]);
                if (!move()) return sb.toString();
            }
            now++;
            return sb.toString();
        }
     
        public long nextLong() throws IOException {
            if (!hasNext()) throw new NullPointerException();
            boolean x = false;
            if (buf[now] == '-') {
                x = true;
                if (!move()) throw new NumberFormatException();
            }
            long ans = 0;
            while (!isSpaceChar(buf[now])) {
                if (isNum(buf[now])) ans = ans * 10 + buf[now] - '0';
                else throw new NumberFormatException();
                if (!move()) break;
            }
            return (x ? -1 : 1) * ans;
        }
     
        public double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
     
        public int nextHexInt() throws IOException {
            if (!hasNext()) throw new NullPointerException();
            boolean x = false;
            if (buf[now] == '-') {
                x = true;
                if (!move()) throw new NumberFormatException();
            }
            int ans = 0;
            while (!isSpaceChar(buf[now])) {
                if (isHex(buf[now])) ans = ans * 16 + toHex(buf[now]);
                else throw new NumberFormatException();
                if (!move()) break;
            }
            return (x ? -1 : 1) * ans;
        }
     
        public char nextChar() throws IOException {
            if (!hasNext()) throw new NullPointerException();
            char tmp = buf[now];
            move();
            return tmp;
        }
        public int next(char[] s) throws IOException {
            if (!hasNext()) throw new NullPointerException();
            int len=0;
            while (!isSpaceChar(buf[now])&&len<s.length) {
                s[len++]=buf[now];
                if (!move()) break;
            }
            return len;
        }
        public boolean hasNext() throws IOException {
            return skip();
        }
     
        public boolean hasNextLine() throws IOException {
            return now < len || refill();
        }
     
        private boolean move() throws IOException {
            now++;
            return hasNextLine();
        }
     
        private boolean skip() throws IOException {
            if (!hasNextLine()) return false;
            while (isSpaceChar(buf[now])) {
                if (!move()) return false;
            }
            return true;
        }
     
        private boolean isSpaceChar(char c) {
            return !(c >= 33 && c <= 126);
        }
     
        private boolean isNum(char c) {
            return c >= '0' && c <= '9';
        }
     
        private boolean isHex(char c) {
            return c >= '0' && c <= '9' || c >= 'A' && c <= 'F';
        }
     
        private int toHex(char c) {
            if (c >= '0' && c <= '9') return c - '0';
            else return c - 'A' + 10;
        }
     
        private boolean refill() throws IOException {
            len = reader.read(buf);
            now = 0;
            return len > 0;
        }
    }
}
