import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.array;

int N, M;
//int[] a, b;
int[][] e;
int[] turn;
int ans;

void Func(int n, int t){
    turn[n] = t + 1;
    foreach(i ; e[n]){
        if(turn[i] != t){
            if(turn[i] > 0){
                if(t + 1 - turn[i] > 0){
                    ans += t + 1 - turn[i] + 1;
                }
            }
            else {
                Func(i, t + 1);
            }
        }
    }
}

void main()
{
    auto input = readln.chomp.split.to!(int[]);
    N = input[0];
    M = input[1];

    turn = new int[N];
    e = new int[][N];
    foreach(i ; 0..M){
        auto input2 = readln.chomp.split.to!(int[]);
        auto a = input2[0];
        auto b = input2[1];
        --a, --b;
        e[a] ~= b;
        e[b] ~= a;
    }

    Func(0, 1);
    (M - ans).writeln;
}