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.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;

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

    static class TaskD {
        public static int dfs(Graph g, int node, int par, boolean[] vis) {
            vis[node] = true;
            int answer = 0;
            for (Graph.Edge edge : g.getEdges(node)) {
                int next = edge.v;
                if (next != par && !vis[next]) {
                    answer += 1;
                    answer += dfs(g, next, node, vis);
                }
            }
            return answer;
        }

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt(), k = in.nextInt();
            Graph g = new Graph(n);
            for (int i = 0; i < k; i++) {
                int u = in.nextInt() - 1, v = in.nextInt() - 1;
                g.addEdge(u, v);
            }
            int edgesExplored = 0;
            boolean[] vis = new boolean[n];
            for (int i = 0; i < n; i++) {
                if (!vis[i]) {
                    edgesExplored += dfs(g, i, -1, vis);
                }
            }
            int ans = k - edgesExplored;
            out.println(ans);
        }

    }

    static class Graph {
        ArrayList<Graph.Edge>[] g = null;

        public Graph(int size) {
            g = new ArrayList[size];
            for (int i = 0; i < size; i++) {
                g[i] = new ArrayList<>();
            }
        }

        public void addEdge(int from, int to) {
            g[from].add(new Graph.Edge(from, to));
            g[to].add(new Graph.Edge(to, from));
        }

        public ArrayList<Graph.Edge> getEdges(int node) {
            return g[node];
        }

        public static class Edge {
            public int u;
            public int v;
            public int w;

            public Edge(int from, int to, int weight) {
                u = from;
                v = to;
                w = weight;
            }

            public Edge(int from, int to) {
                u = from;
                v = to;
                w = 1;
            }

            public Edge(Graph.Edge that) {
                u = that.u;
                v = that.v;
                w = that.w;
            }

            public String toString() {
                return "{" + u + "->" + v + " (" + w + ")" + "}";
            }

        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void println(int i) {
            writer.println(i);
        }

    }
}

