from collections import deque

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



V = [list(map(int, input().split())) for _ in range(M)]



class UnionFind():

    def __init__(self, n):

        self.parents = [-1] * n



    def find(self, x):

        if self.parents[x] < 0:

            return x

        else:

            self.parents[x] = self.find(self.parents[x])

            return self.parents[x]



    def union(self, x, y):

        x = self.find(x)

        y = self.find(y)



        if x == y:

            return False

        if self.parents[x] > self.parents[y]:

            x, y = y, x



        self.parents[x] += self.parents[y]

        self.parents[y] = x

        return True



    def size(self, x):

        return -self.parents[self.find(x)]



    def same(self, x, y):

        return self.find(x) == self.find(y)



ans = 0

for i in range(N):

    for j in range(i+1, N):

        uf = UnionFind(N)

        for a, b in V:

            if a-1 == i and b-1 ==j:

                continue

            uf.union(a-1, b-1)

        if not uf.same(i, j):

            ans += 1

print(ans)

from collections import deque

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



V = [list(map(int, input().split())) for _ in range(M)]



class UnionFind():

    def __init__(self, n):

        self.parents = [-1] * n



    def find(self, x):

        if self.parents[x] < 0:

            return x

        else:

            self.parents[x] = self.find(self.parents[x])

            return self.parents[x]



    def union(self, x, y):

        x = self.find(x)

        y = self.find(y)



        if x == y:

            return False

        if self.parents[x] > self.parents[y]:

            x, y = y, x



        self.parents[x] += self.parents[y]

        self.parents[y] = x

        return True



    def size(self, x):

        return -self.parents[self.find(x)]



    def same(self, x, y):

        return self.find(x) == self.find(y)



ans = 0

for i in range(M):

        uf = UnionFind(N)

        for j, (a, b) in enumerate(V):

            if i != j:

                uf.union(a-1, b-1)

        if not uf.same(V[i][0]-1, V[i][1]-1):

            ans += 1

print(ans)

from collections import deque

N, M = list(map(int, input().split()))
V = [list(map(int, input().split())) for _ in range(M)]


class UnionFind:
    def __init__(self, n):
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return False
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x
        return True

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)


ans = 0
for i in range(N):
    for j in range(i + 1, N):
        uf = UnionFind(N)
        for a, b in V:
            if a - 1 == i and b - 1 == j:
                continue
            uf.union(a - 1, b - 1)
        if not uf.same(i, j):
            ans += 1
print(ans)

from collections import deque

N, M = list(map(int, input().split()))
V = [list(map(int, input().split())) for _ in range(M)]


class UnionFind:
    def __init__(self, n):
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return False
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x
        return True

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)


ans = 0
for i in range(M):
    uf = UnionFind(N)
    for j, (a, b) in enumerate(V):
        if i != j:
            uf.union(a - 1, b - 1)
    if not uf.same(V[i][0] - 1, V[i][1] - 1):
        ans += 1
print(ans)

-for i in range(N): -    for j in range(i + 1, N): -        uf = UnionFind(N) -        for a, b in V: -            if a - 1 == i and b - 1 == j: -                continue +for i in range(M): +    uf = UnionFind(N) +    for j, (a, b) in enumerate(V): +        if i != j: -        if not uf.same(i, j): -            ans += 1 +    if not uf.same(V[i][0] - 1, V[i][1] - 1): +        ans += 1