from collections import defaultdict, deque

import sys

input = sys.stdin.readline





def bfs(s, n, g):

    dist = [-1] * n

    dist[s] = 0

    que = deque([])

    que.append(s)

    while que:

        v = que.popleft()

        for nv in g[v]:

            if dist[nv] != -1:

                continue

            dist[nv] = dist[v] + 1

            que.append(nv)

    if -1 in dist:

        return True

    else:

        return False





def main():

    n, m = list(map(int, input().split()))

    g = [[] for _ in range(n)]

    gg = []

    for _ in range(m):

        a, b = [int(i) - 1 for i in input().split()]

        g[a].append(b)

        g[b].append(a)

        gg.append((a, b))

    ans = 0

    for a, b in gg:

        g[a].remove(b)

        g[b].remove(a)

        if bfs(0, n, g):

            ans += 1

        g[a].append(b)

        g[b].append(a)

    print(ans)

    return





if __name__ == "__main__":

    main()
from collections import defaultdict, deque

import sys

input = sys.stdin.readline

# sys.setrecursionlimit(1000000)

# MOD = 10 ** 9 + 7

# INF = float("inf")





def bfs(s, n, g):

    dist = [-1] * n

    dist[s] = 0

    que = deque([])

    que.append(s)

    while que:

        v = que.popleft()

        for nv in g[v]:

            if dist[nv] != -1:

                continue  # すでに探索している時はスルー

            dist[nv] = dist[v] + 1

            que.append(nv)

    if -1 in dist:

        return True

    else:

        return False





def main():

    n, m = list(map(int, input().split()))

    g = [[] for _ in range(n)]

    gg = []

    for _ in range(m):

        a, b = [int(i) - 1 for i in input().split()]

        g[a].append(b)

        g[b].append(a)

        gg.append((a, b))

    ans = 0

    for a, b in gg:

        g[a].remove(b)

        g[b].remove(a)

        if bfs(0, n, g):

            ans += 1

        g[a].append(b)

        g[b].append(a)

    print(ans)

    return





if __name__ == "__main__":

    main()
from collections import defaultdict, deque
import sys

input = sys.stdin.readline


def bfs(s, n, g):
    dist = [-1] * n
    dist[s] = 0
    que = deque([])
    que.append(s)
    while que:
        v = que.popleft()
        for nv in g[v]:
            if dist[nv] != -1:
                continue
            dist[nv] = dist[v] + 1
            que.append(nv)
    if -1 in dist:
        return True
    else:
        return False


def main():
    n, m = list(map(int, input().split()))
    g = [[] for _ in range(n)]
    gg = []
    for _ in range(m):
        a, b = [int(i) - 1 for i in input().split()]
        g[a].append(b)
        g[b].append(a)
        gg.append((a, b))
    ans = 0
    for a, b in gg:
        g[a].remove(b)
        g[b].remove(a)
        if bfs(0, n, g):
            ans += 1
        g[a].append(b)
        g[b].append(a)
    print(ans)
    return


if __name__ == "__main__":
    main()

from collections import defaultdict, deque
import sys

input = sys.stdin.readline
# sys.setrecursionlimit(1000000)
# MOD = 10 ** 9 + 7
# INF = float("inf")
def bfs(s, n, g):
    dist = [-1] * n
    dist[s] = 0
    que = deque([])
    que.append(s)
    while que:
        v = que.popleft()
        for nv in g[v]:
            if dist[nv] != -1:
                continue  # すでに探索している時はスルー
            dist[nv] = dist[v] + 1
            que.append(nv)
    if -1 in dist:
        return True
    else:
        return False


def main():
    n, m = list(map(int, input().split()))
    g = [[] for _ in range(n)]
    gg = []
    for _ in range(m):
        a, b = [int(i) - 1 for i in input().split()]
        g[a].append(b)
        g[b].append(a)
        gg.append((a, b))
    ans = 0
    for a, b in gg:
        g[a].remove(b)
        g[b].remove(a)
        if bfs(0, n, g):
            ans += 1
        g[a].append(b)
        g[b].append(a)
    print(ans)
    return


if __name__ == "__main__":
    main()

- - +# sys.setrecursionlimit(1000000) +# MOD = 10 ** 9 + 7 +# INF = float("inf") -                continue +                continue  # すでに探索している時はスルー