from scipy.sparse.csgraph import connected_components  # https://note.nkmk.me/python-scipy-connected-components/

from scipy.sparse import csr_matrix



N, M = list(map(int, input().split()))  # 頂点数、辺数

A, B, C = [0] *  M, [0] * M, [1] * (M-1)

for i in range(M):

    A[i], B[i] = list(map(int, input().split()))

    A[i]-=1

    B[i]-=1



cnt = 0

for i in range(M):

    csr = csr_matrix((C, (A[:i] + A[i + 1:], B[:i] + B[i + 1:])), shape=(N, N))

    n, labels = connected_components(csr)

    if n == 2:

       cnt += 1

print(cnt)

from scipy.sparse.csgraph import connected_components  # Pythonのみ！

# ↑cf.  https://note.nkmk.me/python-scipy-connected-components/

from scipy.sparse import csr_matrix

# import string

import sys

sys.setrecursionlimit(10 ** 5 + 10)

def input(): return sys.stdin.readline().strip()





def resolve():

    from scipy.sparse.csgraph import connected_components  # https://note.nkmk.me/python-scipy-connected-components/

    from scipy.sparse import csr_matrix

    

    N, M = list(map(int, input().split()))  # 頂点数、辺数

    A, B, C = [0] *  M, [0] * M, [1] * (M-1)

    for i in range(M):

        A[i], B[i] = list(map(int, input().split()))

        A[i]-=1

        B[i]-=1

    

    cnt = 0

    for i in range(M):

        #print(B[:i] + B[i + 1:i + M] + B[i + M + 1:])

        #print(A[:i] + A[i + 1:i + M] + A[i + M + 1:])

        csr = csr_matrix((C, (A[:i] + A[i + 1:], B[:i] + B[i + 1:])), shape=(N, N))

        #print(csr)

        #print('haha')

        n, labels = connected_components(csr)

        if n == 2:

           cnt += 1

    print(cnt)





resolve()

from scipy.sparse.csgraph import (
    connected_components,
)  # https://note.nkmk.me/python-scipy-connected-components/
from scipy.sparse import csr_matrix

N, M = list(map(int, input().split()))  # 頂点数、辺数
A, B, C = [0] * M, [0] * M, [1] * (M - 1)
for i in range(M):
    A[i], B[i] = list(map(int, input().split()))
    A[i] -= 1
    B[i] -= 1
cnt = 0
for i in range(M):
    csr = csr_matrix((C, (A[:i] + A[i + 1 :], B[:i] + B[i + 1 :])), shape=(N, N))
    n, labels = connected_components(csr)
    if n == 2:
        cnt += 1
print(cnt)

from scipy.sparse.csgraph import connected_components  # Pythonのみ！

# ↑cf.  https://note.nkmk.me/python-scipy-connected-components/
from scipy.sparse import csr_matrix

# import string
import sys

sys.setrecursionlimit(10**5 + 10)


def input():
    return sys.stdin.readline().strip()


def resolve():
    from scipy.sparse.csgraph import (
        connected_components,
    )  # https://note.nkmk.me/python-scipy-connected-components/
    from scipy.sparse import csr_matrix

    N, M = list(map(int, input().split()))  # 頂点数、辺数
    A, B, C = [0] * M, [0] * M, [1] * (M - 1)
    for i in range(M):
        A[i], B[i] = list(map(int, input().split()))
        A[i] -= 1
        B[i] -= 1
    cnt = 0
    for i in range(M):
        # print(B[:i] + B[i + 1:i + M] + B[i + M + 1:])
        # print(A[:i] + A[i + 1:i + M] + A[i + M + 1:])
        csr = csr_matrix((C, (A[:i] + A[i + 1 :], B[:i] + B[i + 1 :])), shape=(N, N))
        # print(csr)
        # print('haha')
        n, labels = connected_components(csr)
        if n == 2:
            cnt += 1
    print(cnt)


resolve()

-from scipy.sparse.csgraph import ( -    connected_components, -)  # https://note.nkmk.me/python-scipy-connected-components/ +from scipy.sparse.csgraph import connected_components  # Pythonのみ！ + +# ↑cf.  https://note.nkmk.me/python-scipy-connected-components/ -N, M = list(map(int, input().split()))  # 頂点数、辺数 -A, B, C = [0] * M, [0] * M, [1] * (M - 1) -for i in range(M): -    A[i], B[i] = list(map(int, input().split())) -    A[i] -= 1 -    B[i] -= 1 -cnt = 0 -for i in range(M): -    csr = csr_matrix((C, (A[:i] + A[i + 1 :], B[:i] + B[i + 1 :])), shape=(N, N)) -    n, labels = connected_components(csr) -    if n == 2: -        cnt += 1 -print(cnt) +# import string +import sys + +sys.setrecursionlimit(10**5 + 10) + + +def input(): +    return sys.stdin.readline().strip() + + +def resolve(): +    from scipy.sparse.csgraph import ( +        connected_components, +    )  # https://note.nkmk.me/python-scipy-connected-components/ +    from scipy.sparse import csr_matrix + +    N, M = list(map(int, input().split()))  # 頂点数、辺数 +    A, B, C = [0] * M, [0] * M, [1] * (M - 1) +    for i in range(M): +        A[i], B[i] = list(map(int, input().split())) +        A[i] -= 1 +        B[i] -= 1 +    cnt = 0 +    for i in range(M): +        # print(B[:i] + B[i + 1:i + M] + B[i + M + 1:]) +        # print(A[:i] + A[i + 1:i + M] + A[i + M + 1:]) +        csr = csr_matrix((C, (A[:i] + A[i + 1 :], B[:i] + B[i + 1 :])), shape=(N, N)) +        # print(csr) +        # print('haha') +        n, labels = connected_components(csr) +        if n == 2: +            cnt += 1 +    print(cnt) + + +resolve()