# ABC075C - Bridge

# find the number of bridges in a given undirected connected graph

# bridge := an edge whose removal disconnects a graph

import sys

from copy import deepcopy



input = sys.stdin.readline

sys.setrecursionlimit(10 ** 9)





def dfs(v: int) -> None:

    seen[v] = 1  # make vertex v searched

    for u in g[v]:

        if not seen[u]:

            dfs(u)





def main():  # O(M(N + M))

    global g, seen

    N, M = tuple(map(int, input().split()))

    E = tuple(tuple(map(int, input().split())) for _ in range(M))

    G = [[] for _ in range(N + 1)]  # N+1: 1-idx

    for v, u in E:  # construct a undirected graph

        G[v] += [u]

        G[u] += [v]

    bridges = 0

    for v, u in E:

        g = deepcopy(G)  # subgraph of G except E(v, u)

        g[v].remove(u)

        g[u].remove(v)

        seen = [0] * (N + 1)

        dfs(1)  # search from vertex 1

        bridges += 1 if 0 in seen[1:] else 0

    print(bridges)





if __name__ == "__main__":

    main()
# ABC075C - Bridge

# find the number of bridges in a given undirected connected graph

# bridge := an edge whose removal disconnects a graph

def dfs(start: int) -> None:

    seen[start] = 1  # make vertex v searched

    stack = [start]

    while stack:

        v = stack.pop()

        for u in g[v]:

            if not seen[u]:

                seen[u] = 1

                stack.append(u)





def main():  # O(M(N + M))

    global g, seen

    N, M, *E = list(map(int, open(0).read().split()))

    G = [[] for _ in range(N + 1)]

    for v, u in zip(*[iter(E)] * 2):

        G[v].append(u), G[u].append(v)

    bridges = 0

    for v, u in zip(*[iter(E)] * 2):

        g = [v.copy() for v in G]  # subgraph of G except E(v, u)

        g[v].remove(u), g[u].remove(v)

        seen = [0] * (N + 1)

        dfs(1)  # search from vertex 1

        bridges += 1 if 0 in seen[1:] else 0

    print(bridges)





if __name__ == "__main__":

    main()
# ABC075C - Bridge
# find the number of bridges in a given undirected connected graph
# bridge := an edge whose removal disconnects a graph
import sys
from copy import deepcopy

input = sys.stdin.readline
sys.setrecursionlimit(10**9)


def dfs(v: int) -> None:
    seen[v] = 1  # make vertex v searched
    for u in g[v]:
        if not seen[u]:
            dfs(u)


def main():  # O(M(N + M))
    global g, seen
    N, M = tuple(map(int, input().split()))
    E = tuple(tuple(map(int, input().split())) for _ in range(M))
    G = [[] for _ in range(N + 1)]  # N+1: 1-idx
    for v, u in E:  # construct a undirected graph
        G[v] += [u]
        G[u] += [v]
    bridges = 0
    for v, u in E:
        g = deepcopy(G)  # subgraph of G except E(v, u)
        g[v].remove(u)
        g[u].remove(v)
        seen = [0] * (N + 1)
        dfs(1)  # search from vertex 1
        bridges += 1 if 0 in seen[1:] else 0
    print(bridges)


if __name__ == "__main__":
    main()

# ABC075C - Bridge
# find the number of bridges in a given undirected connected graph
# bridge := an edge whose removal disconnects a graph
def dfs(start: int) -> None:
    seen[start] = 1  # make vertex v searched
    stack = [start]
    while stack:
        v = stack.pop()
        for u in g[v]:
            if not seen[u]:
                seen[u] = 1
                stack.append(u)


def main():  # O(M(N + M))
    global g, seen
    N, M, *E = list(map(int, open(0).read().split()))
    G = [[] for _ in range(N + 1)]
    for v, u in zip(*[iter(E)] * 2):
        G[v].append(u), G[u].append(v)
    bridges = 0
    for v, u in zip(*[iter(E)] * 2):
        g = [v.copy() for v in G]  # subgraph of G except E(v, u)
        g[v].remove(u), g[u].remove(v)
        seen = [0] * (N + 1)
        dfs(1)  # search from vertex 1
        bridges += 1 if 0 in seen[1:] else 0
    print(bridges)


if __name__ == "__main__":
    main()

-import sys -from copy import deepcopy - -input = sys.stdin.readline -sys.setrecursionlimit(10**9) - - -def dfs(v: int) -> None: -    seen[v] = 1  # make vertex v searched -    for u in g[v]: -        if not seen[u]: -            dfs(u) +def dfs(start: int) -> None: +    seen[start] = 1  # make vertex v searched +    stack = [start] +    while stack: +        v = stack.pop() +        for u in g[v]: +            if not seen[u]: +                seen[u] = 1 +                stack.append(u) -    N, M = tuple(map(int, input().split())) -    E = tuple(tuple(map(int, input().split())) for _ in range(M)) -    G = [[] for _ in range(N + 1)]  # N+1: 1-idx -    for v, u in E:  # construct a undirected graph -        G[v] += [u] -        G[u] += [v] +    N, M, *E = list(map(int, open(0).read().split())) +    G = [[] for _ in range(N + 1)] +    for v, u in zip(*[iter(E)] * 2): +        G[v].append(u), G[u].append(v) -    for v, u in E: -        g = deepcopy(G)  # subgraph of G except E(v, u) -        g[v].remove(u) -        g[u].remove(v) +    for v, u in zip(*[iter(E)] * 2): +        g = [v.copy() for v in G]  # subgraph of G except E(v, u) +        g[v].remove(u), g[u].remove(v)