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.
//package com.company;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.sql.SQLOutput;
import java.util.*;
public class Main {

    public static void main(String[] args) throws IOException {
        Scanner s = new Scanner(System.in);
        StringBuilder sb=new StringBuilder();
        //BufferedReader s=new BufferedReader(new InputStreamReader(System.in));
    int n=s.nextInt();
    int m=s.nextInt();
    vis=new int[n+1]; ans=0;
    ArrayList<Integer>[] adj=new ArrayList[n+1];
    int [] newvis=new int[n+1];
    HashMap<Integer,Integer>[] h=new HashMap[n+1];
    for(int i=0;i<m;i++){
        int u=s.nextInt();int v=s.nextInt();
        if(h[u]!=null&&h[u].containsKey(v)){ ans+=1;continue;}
        if(h[u]==null) h[u]=new HashMap<Integer, Integer>();
        if(h[v]==null) h[v]=new HashMap<Integer, Integer>();
        h[u].put(v,1);h[v].put(u,1);
         if(adj[u]==null) adj[u]=new ArrayList<Integer>();
         if(adj[v]==null) adj[v]=new ArrayList<Integer>();
         adj[u].add(v);
         adj[v].add(u);
    }
      //  System.out.println(ans);
    for(int i=1;i<=n;i++){
        if(vis[i]==0){ans1=0;
            dfs(adj,i,-1);ans+=ans1/2;
      //    System.out.println(i+" "+ans);
        }
    }
        System.out.println(ans);
    }static int[] vis;static int ans;static int ans1=0;
    static void dfs(ArrayList<Integer>[] adj,int i,int papa){
        vis[i]=1;
        if(adj[i]!=null){
            for(int j:adj[i]){
                if(vis[j]==1&&j!=papa) {ans1++;}
           //         System.out.println("HI"+i+" "+j);}
                else if(vis[j]==0) dfs(adj,j,i);
            }
        }
    }
    static  void computeLPSArray(String pat, int M, int lps[])
    {
        int len = 0;
        int i = 1;
        lps[0] = 0;
        while (i < M) {
            if (pat.charAt(i) == pat.charAt(len)) {
                len++;
                lps[i] = len;
                i++;
            }
            else // (pat[i] != pat[len])
            {
                if (len != 0) {
                    len = lps[len - 1];
                }
                else // if (len == 0)
                {
                    lps[i] = len;
                    i++;
                }
            }
        }
    }
    static boolean isPrime(int n)
    {
        if (n <= 1) return false;
        if (n <= 3) return true;

        if (n % 2 == 0 || n % 3 == 0) return false;

        for (int i = 5; i * i <= n; i = i + 6)
            if (n % i == 0 || n % (i + 2) == 0)
                return false;

        return true;
    }

    static double power(double x, long y, int p) {
        double res = 1;
        x = x % p;
        while (y > 0) {
            if ((y & 1) == 1)
                res = (res * x) % p;
            y = y >> 1;
            x = (x * x) % p;
        }
        return res;
    }
    public static void fracion(double x) {
        String a = "" + x;
        String spilts[] = a.split("\\."); // split using decimal
        int b = spilts[1].length(); // find the decimal length
        int denominator = (int) Math.pow(10, b); // calculate the denominator
        int numerator = (int) (x * denominator); // calculate the nerumrator Ex
        // 1.2*10 = 12
        int gcd = (int)gcd((long)numerator, denominator); // Find the greatest common
        // divisor bw them
        String fraction = "" + numerator / gcd + "/" + denominator / gcd;
        // System.out.println((denominator/gcd));
        long x1=modInverse(denominator / gcd,998244353  );
        //  System.out.println(x1);
        System.out.println((((numerator / gcd )%998244353 *(x1%998244353  ))%998244353  ) );
    }static int anst=Integer.MAX_VALUE;
    static StringBuilder sb1=new StringBuilder();
    public static int bfs(int i1, ArrayList<Integer>[] h, int[] vis, int n,int val1) {
        Queue<Integer> q = new LinkedList<Integer>();
        q.add(i1);Queue<Integer> aq=new LinkedList<Integer>();
        aq.add(0);
        while(!q.isEmpty()){
            int i=q.poll();
            int val=aq.poll();
            if(i==n){
                return val;
            }
            if(h[i]!=null){
                for(Integer j:h[i]){
                    if(vis[j]==0){
                        q.add(j);vis[j]=1;
                        aq.add(val+1);}
                }
            }
        }return -1;
    }
    static int i(String a) {
        return Integer.parseInt(a);
    }
    static long l(String a) {
        return Long.parseLong(a);
    }
    static String[] inp() throws IOException {
        BufferedReader s = new BufferedReader(new InputStreamReader(System.in));
        return s.readLine().trim().split("\\s+");
    }


    static long gcd(long a, long b) {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }
    static long modInverse(int a, int m)
    {


        {
            // If a and m are relatively prime, then modulo inverse
            // is a^(m-2) mode m
            return (power(a, m - 2, m));
        }
    }

    // To compute x^y under modulo m
    static long power(int x, int y, int m)
    {
        if (y == 0)
            return 1;

        long p = power(x, y / 2, m) % m;
        p = (p * p) % m;

        if (y % 2 == 0)
            return p;
        else
            return (x * p) % m;
    }

    // Function to return gcd of a and b

}
class Student
{
    int l;int r;
    public Student(int l, int r) {
        this.l = l;
        this.r = r;
    }
    // Constructor


    // Used to print student details in main()
    public String toString()
    {
        return this.l+" ";
    }
}

class Sortbyroll implements Comparator<Student>
{
    // Used for sorting in ascending order of
    // roll number
    public int compare(Student a, Student b){
        if(a.l==b.l) return a.r-b.r;
        return b.l-a.l;  }
} class Sortbyroll1 implements Comparator<Student>
{
    // Used for sorting in ascending order of
    // roll number
    public int compare(Student a, Student b){
        if(a.r==b.r) return a.l-b.l;
        return b.l-a.l;
    }
}