import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

int readint() {
    return readln.chomp.to!int;
}

int[] readints() {
    return readln.split.map!(to!int).array;
}

int calc(int n, bool[][] adj) {
    auto refs = new int[](n + 1);

    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
            if (adj[i][j])
                refs[j]++;
        }
    }

    int ans = 0;
    bool update = true;
    while (update) {
        update = false;

        for (int i = 1; i <= n; i++) {
            if (refs[i] == 1) {
                ans++;
                update = true;
                refs[i] = 0;

                for (int j = 1; j <= n; j++) {
                    if (adj[i][j]) {
                        refs[j]--;
                    }
                }
            }
        }
    }
    return ans;
}

void main() {
    auto nm = readints;
    int n = nm[0], m = nm[1];

    auto adj = new bool[][](n + 1, n + 1);
    for (int i = 0; i < m; i++) {
        auto ab = readints;
        int a = ab[0], b = ab[1];

        adj[a][b] = adj[b][a] = true;
    }

    writeln(calc(n, adj));
}
