CodeEff/ECCO huggingface dataset:
# Original solution
import copy

N,M=list(map(int,input().split()))
l_2d = [[0] * N for i in range(N)]
edges=[]

def dfs(i):
    l_visit[i-1]=1
    for j in range(1,N+1):
        if l_2d_temp[i-1][j-1]==1 and l_visit[j-1]==0:
            dfs(j)
    return

for _ in range(M):
    i,j=list(map(int,input().split()))
    edges.append([i,j])
    l_2d[i-1][j-1]=1
    l_2d[j-1][i-1]=1
    
ans=0
for edge in edges:
    i,j=edge
    l_2d_temp=copy.deepcopy(l_2d)
    l_2d_temp[i-1][j-1]=0
    l_2d_temp[j-1][i-1]=0

    l_visit=[0]*N

    dfs(1)
    if 0 in l_visit:
        ans+=1

print(ans)

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

R = []
G = {k: [] for k in range(N)}  # 0-indexed
for _ in range(M):
    a, b = list(map(int, input().split()))
    G[a-1].append(b-1)
    G[b-1].append(a-1)
    R.append((a-1, b-1))


def dfs(p, i, arrived):
    for n in G[p]:
        if arrived[n] is False and tuple(sorted((p, n))) != R[i]:
            arrived[n] = True
            dfs(n, i, arrived)


ans = 0
for i in range(M):
    arrived = [False]*N
    arrived[0] = True
    dfs(0, i, arrived)
    if not all(arrived):
        ans += 1
print(ans)
# Original solution
n,m=list(map(int,input().split()))
e=[]
for i in range(m):
    e.append(list(map(int,input().split())))
ans=0
for i in range(m):
    nall=[]
    for j in range(m):
        if i==j:
            continue
        nall.append(e[j])
    visited=[0]*n
    visited[0]=1
    t=[1]
    while len(t)>0:
        tmp=[]
        ntmp=[]
        for p in t:
            visited[p-1]=1
            for q in nall:
                if q[0]==p:
                    if visited[q[1]-1]==0:
                        tmp.append(q[1])
                        visited[q[1]-1]=1
                elif q[1]==p:
                    if visited[q[0]-1]==0:
                        tmp.append(q[0])
                        visited[q[0]-1]=1
                else:
                    if visited[q[0]-1]==0 or visited[q[1]-1]==0:
                        ntmp.append(q)
        t=tmp
        nall=ntmp
    if sum(visited)!=n:
        ans+=1
print(ans)
                    


# Optimized solution
n,m=list(map(int,input().split()))
e=[]
for i in range(m):
    e.append(list(map(int,input().split())))
ans=0
for i in range(m):
    g=[[] for _ in range(n)]
    for j in range(m):
        if i==j:
            continue
        g[e[j][0]-1].append(e[j][1])
        g[e[j][1]-1].append(e[j][0])
    visited=[0]*n
    visited[0]=1
    q=[1]
    while len(q)>0:
        a=q.pop(0)
        visited[a-1]=1
        for k in g[a-1]:
            if visited[k-1]==0:
                q+=[k]
    if sum(visited)!=n:
        ans+=1
print(ans)
# Original solution
n, m = list(map(int, input().split()))
G = [[] for i in range(n)]
E = []
for i in range(m):
    a, b = list(map(int, input().split()))
    G[a-1].append(b-1)
    G[b-1].append(a-1)
    E.append((a-1, b-1))
from collections import deque
def solve(s, t):
    if len(G[s]) == 1 or len(G[t]) == 1:
        return 1
    used = [0]*n
    que = deque()
    used[s] = 1
    for v in G[s]:
        if v == t:
            continue
        used[v] = 1
        que.append(v)
    while que:
        u = que.popleft()
        for v in G[u]:
            if not used[v]:
                used[v] = 1
                que.append(v)
    return sum(used) != n
ans = 0
for a, b in E:
    ans += solve(a, b)
print(ans)


# Optimized solution
n, m = list(map(int, input().split()))
G = [[] for i in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    G[a-1].append(b-1)
    G[b-1].append(a-1)
def bridge(g, v, s=0):
    bl = [False] * v
    c_memo = [0] * v
    c_used = [False] * v
    b_g = [[] for i in range(v)]
    def dfs(v, f, l):
        bcnt = fcnt = 0
        c_used[v] = True
        for t in g[v]:
            if not c_used[t]:
                ll = []
                ret = dfs(t, v, ll)
                if ret>0:
                    l += ll
                else:
                    b_g[t] = ll
                    for u in ll:
                        b_g[u].append(t)
                    l.append(t)
                bcnt += ret
            else:
                if t==f:
                    if fcnt==1:
                        c_memo[f] -= 1
                        bcnt += 1
                    fcnt += 1
                elif not bl[t]:
                    c_memo[t] -= 1
                    bcnt += 1
        bl[v] = True
        bcnt += c_memo[v]
        return bcnt
    dfs(s, -1, b_g[s])
    for u in b_g[s]:
        b_g[u].append(s)
    return b_g
G = bridge(G, n)
ans = 0
for i in range(n):
    for v in G[i]:
        if i < v:
            ans += 1
print(ans)
# Original solution
from itertools import chain
import copy

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

lis = [[10000000 for i in range(n)] for j in range(n)]
hen = []
for _ in range(m):
    hen.append(list(map(int, input().split())))

ans = 0
for x in range(m):
    lis_tmp = copy.deepcopy(lis)
    bri = copy.deepcopy(hen)
    bri.pop(x)
    for y in range(m-1):
        lis_tmp[bri[y][0]-1][bri[y][1]-1] = 1
        lis_tmp[bri[y][1]-1][bri[y][0]-1] = 1

    for k in range(n):
        for i in range(n):
            for j in range(n):
                lis_tmp[i][j] = min(lis_tmp[i][j], lis_tmp[i][k] + lis_tmp[k][j])

    if 10000000 in list(chain.from_iterable(lis_tmp)):
        ans += 1

print(ans)

# Optimized solution
n, m = list(map(int, input().split()))
hen = []
for _ in range(m):
    hen.append(list(map(int, input().split())))

def dfs(vis, graph, x, n):
    vis[x] = True
    for i in range(n):
        if graph[x][i] == False:
            continue
        if vis[i] == True:
            continue
        dfs(vis, graph, i, n)
    return vis


ans = 0
for i in range(m):
    graph = [[False for _ in range(n)] for _ in range(n)]
    rng = [a for a in range(m)]
    del rng[i]
    for y in rng:
        graph[hen[y][0]-1][hen[y][1]-1] = True
        graph[hen[y][1]-1][hen[y][0]-1] = True
    vis = [False for _ in range(n)]
    vis = dfs(vis, graph, 0, n)
    connected = True
    for k in range(n):
        if vis[k] == False:
            connected = False
    if connected == False:
        ans += 1

print(ans)
# Original solution
class UnionFind:
    def __init__(self, size):
        self.table = [-1 for _ in range(size)]

    def find(self, x):
        while self.table[x] >= 0:
            x = self.table[x]
        return x

    def union(self, x, y):
        s1 = self.find(x)
        s2 = self.find(y)
        if s1 != s2:
            if self.table[s1] != self.table[s2]:
                if self.table[s1] < self.table[s2]:
                    self.table[s2] = s1
                else:
                    self.table[s1] = s2
            else:
                self.table[s1] += -1
                self.table[s2] = s1
        return


n, m = list(map(int, input().split()))
edges = [list(map(int, input().split())) for _ in range(m)]

ans = 0
for i in range(m):
    uf = UnionFind(n)
    for j in range(m):
        if i != j:
            uf.union(edges[j][0]-1, edges[j][1]-1)
    c = 0
    for j in range(n):
        if j == uf.find(j):
            c += 1
    if c > 1:
        ans += 1

print(ans)


# Optimized solution
class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1


n, m = list(map(int, input().split()))
edges = [list(map(int, input().split())) for _ in range(m)]

ans = 0
for i in range(m):
    uf = UnionFind(n)
    for j in range(m):
        if i != j:
            uf.union(edges[j][0]-1, edges[j][1]-1)
    c = 0
    for j in range(n):
        if j == uf.find(j):
            c += 1
    if c > 1:
        ans += 1

print(ans)
# Original solution
class UnionFind:
  def __init__(self, num):
    self.rank = [0]*num
    self.par = [i for i in range(num)] #基準(par = parentのpar)
    self.n   = num
    self.size = [1]*num

#親を探す
  def find(self, x):
    if self.par[x] == x:
      return x
    else:
      self.par[x] = self.find(self.par[x]) #自分じゃなきゃ親を探す
      return self.par[x]

#集合を結合する(結合する前に親のポインタを取得する)
  def union(self, x, y):
    x = self.find(x)
    y = self.find(y)
    if x == y:
      return
    if self.rank[x] < self.rank[y]: #ランクの高い方に基準を合わせる
      x,y=y,x
    if self.rank[x] == self.rank[y]:
      self.rank[x] += 1
    self.par[y] = x
    self.size[x] += self.size[y]
    self.size[y] = 0

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

  def all_find(self):
    for n in range(len(self.par)):
      self.find(n)


n,m=list(map(int,input().split()))
# edges=[[0]*n for i in range(n)]
# uf=UnionFind(n)
ans=0
# ab=[]
# for i in range(m):
#   a,b=map(int,input().split())
#   ab.append([a,b])
#   uf.union(a-1,b-1)
# for i in range(m):
#   uf1=UnionFind(n)
#   for j in range(m):
#     a,b=ab[j]
#     if i==j:
#       continue
#     uf1.union(a-1,b-1)
#   if all([True if i==j else False for i,j in zip(uf.par,uf1.par)])!=True:
#     ans+=1
nl=[]
for i in range(m):
    f,t=list(map(int,input().split()))
    nl.append([f-1,t-1])
for i in range(m):
    uf=UnionFind(n)
    flag=False
    for j in range(m):
        if i==j:
            continue
        uf.union(nl[j][0],nl[j][1])
    nl.append(t)
    for j in range(n):
        for k in range(n):
            if not uf.same(j,k):
                flag=True
    if flag:
        ans+=1
print(ans)

# Optimized solution
class UnionFind:
  def __init__(self, num):
    self.rank = [0]*num
    self.par = [i for i in range(num)] #基準(par = parentのpar)
    self.n   = num
    self.size = [1]*num

#親を探す
  def find(self, x):
    if self.par[x] == x:
      return x
    else:
      self.par[x] = self.find(self.par[x]) #自分じゃなきゃ親を探す
      return self.par[x]

#集合を結合する(結合する前に親のポインタを取得する)
  def union(self, x, y):
    x = self.find(x)
    y = self.find(y)
    if x == y:
      return
    if self.rank[x] < self.rank[y]: #ランクの高い方に基準を合わせる
      x,y=y,x
    if self.rank[x] == self.rank[y]:
      self.rank[x] += 1
    self.par[y] = x
    self.size[x] += self.size[y]
    self.size[y] = 0

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

  def all_find(self):
    for n in range(len(self.par)):
      self.find(n)


n,m=list(map(int,input().split()))
uf=UnionFind(n)
ans=0
ab=[]
for i in range(m):
  a,b=list(map(int,input().split()))
  ab.append([a,b])
for i in range(m):
  uf=UnionFind(n)
  flag=False
  for j in range(m):
    a,b=ab[j]
    if i==j:
      continue
    uf.union(a-1,b-1)
  for j in range(n):
    for k in range(j,n):
      if not uf.same(j,k):
        flag=True
  if flag:
    ans+=1

print(ans)
# Original solution

class UnionFind:
    def __init__(self, size):
        self.table = [i for i in range(size)]

    def find(self, x):
        return self.table[x]

    def union(self, x, y):
        x1 = self.find(x)
        y1 = self.find(y)

        if x1 == y1:
            return False

        for i in range(len(self.table)):
            if self.table[i] == y1:
                self.table[i] = x1
        return True


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

edges = []
for _ in range(M):
    a, b = list(map(int, input().split()))
    edges.append([a-1, b-1])

mat = [[0]*N for _ in range(N)]
for s, g in edges:
    mat[s][g] = 1
    mat[g][s] = 1

ans = 0

for i in range(M):
    uni = UnionFind(N)

    for j in range(M):
        if i != j:
            uni.union(edges[j][0], edges[j][1])

    if not all(uni.find(0) == uni.find(x) for x in range(N)):
        ans += 1
print(ans)


# Optimized solution
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


class UnionFind:
    def __init__(self, size):
        """
        size:頂点の数
        """
        self.parent = [i for i in range(size)]
        self.rank = [0 for _ in range(size)]

    def find(self, x):
        """
        xのrootを返す
        """
        if self.parent[x] == x:
            return x
        else:
            return self.find(self.parent[x])

    def union(self, x, y):
        """
        x,yを同じグループとしてまとめる
        """
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return

        if self.rank[x] < self.rank[y]:
            self.parent[x] = y
        else:
            self.parent[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    def same(self, x, y):
        """
        xとyが同じグループならTrue
        """
        return self.find(x) == self.find(y)

    def component(self):
        """
        各連結成分のrootの集合を返す
        len()をとれば連結成分の数が求められる
        return-> set()
        """
        comp = set()
        for i in self.parent:
            p = self.find(i)
            comp.add(p)
        return comp

    def __str__(self):
        """
        for debug
        クラスのlistの情報を出力
        """
        ret = "parents\n"
        ret += " ".join(map(str, self.parent))
        ret += '\n'
        ret += " ".join(map(str, self.rank))
        return ret


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

for _ in range(M):
    a, b = [int(x)-1 for x in input().split()]
    edges.append([a, b])

ans = 0
for e in edges:
    Un = UnionFind(N)
    for g in edges:
        if e == g:
            continue
        else:
            Un.union(g[0], g[1])
    if not Un.same(e[0], e[1]):
        ans += 1
print(ans)
# Original solution
#!/usr/bin/env python3

from copy import deepcopy

def dfs(x, adj, visited):
    for y, flag in enumerate(adj[x]):
        if flag and y not in visited:
            visited.add(y)
            dfs(y, adj, visited)

def main():
    n, m = list(map(int, input().split()))
    adj = [[(i == j) for i in range(n)] for j in range(n)]
    edges = set()
    for i in range(m):
        a1, b1 = list(map(int, input().split()))
        a = a1 - 1
        b = b1 - 1
        edges.add((a, b))
        adj[a][b] = True
        adj[b][a] = True

    res = 0
    for e in edges:
        adjc = deepcopy(adj)
        adjc[e[0]][e[1]] = False
        adjc[e[1]][e[0]] = False
        visited = {0}
        dfs(0, adjc, visited)
        if len(visited) < n:
            res += 1
    print(res)

main()


# Optimized solution
#!/usr/bin/env python3

from copy import deepcopy

def dfs(x, adj, visited):
    for y, flag in enumerate(adj[x]):
        if flag and y not in visited:
            visited.add(y)
            dfs(y, adj, visited)

def is_simply_connected(adj):
    n = len(adj)
    visited = {0}
    dfs(0, adj, visited)
    return len(visited) == n

def main():
    n, m = list(map(int, input().split()))
    adj = [[(i == j) for i in range(n)] for j in range(n)]
    edges = set()
    for i in range(m):
        a1, b1 = list(map(int, input().split()))
        a = a1 - 1
        b = b1 - 1
        edges.add((a, b))
        adj[a][b] = True
        adj[b][a] = True

    res = 0
    for a, b in edges:
        adjc = deepcopy(adj)
        adjc[a][b] = False
        adjc[b][a] = False
        if not is_simply_connected(adjc):
            res += 1
    print(res)

main()
# Original solution
#!/usr/bin/env python3

from copy import deepcopy

def dfs(x, adj, visited):
    for y, flag in enumerate(adj[x]):
        if flag and y not in visited:
            visited.add(y)
            dfs(y, adj, visited)

def is_simply_connected(adj):
    n = len(adj)
    visited = {0}
    dfs(0, adj, visited)
    return len(visited) == n

def main():
    n, m = list(map(int, input().split()))
    adj = [[(i == j) for i in range(n)] for j in range(n)]
    edges = set()
    for i in range(m):
        a1, b1 = list(map(int, input().split()))
        a = a1 - 1
        b = b1 - 1
        edges.add((a, b))
        adj[a][b] = True
        adj[b][a] = True

    res = 0
    for a, b in edges:
        adjc = deepcopy(adj)
        adjc[a][b] = False
        adjc[b][a] = False
        if not is_simply_connected(adjc):
            res += 1
    print(res)

main()


# Optimized solution
#!/usr/bin/env python3

from copy import deepcopy

def dfs(x, adj, visited):
    for y, flag in enumerate(adj[x]):
        if flag and y not in visited:
            visited.add(y)
            dfs(y, adj, visited)

def is_simply_connected(adj):
    n = len(adj)
    visited = {0}  # O(log n). Use list instead.
    dfs(0, adj, visited)
    return len(visited) == n

def main():
    n, m = list(map(int, input().split()))
    adj = [[(i == j) for i in range(n)] for j in range(n)]
    edges = set()
    for i in range(m):
        a1, b1 = list(map(int, input().split()))
        a = a1 - 1
        b = b1 - 1
        edges.add((a, b))
        adj[a][b] = True
        adj[b][a] = True

    res = 0
    for a, b in edges:
        adj[a][b] = adj[b][a] = False
        if not is_simply_connected(adj):
            res += 1
        adj[a][b] = adj[b][a] = True
    print(res)

main()
# Original solution
from collections import deque

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

for _ in range(M):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    edges.append((a, b))

ans = 0
for removeEdge in range(M):
    confilm = [False for _ in range(N)]
    que = deque([])
    que.append(0)

    while que:
        now = que.popleft()
        confilm[now] = True
        for i, (a, b) in enumerate(edges):
            if i == removeEdge:
                continue
            if a == now:
                if not confilm[b]:
                    que.append(b)
            if b == now:
                if not confilm[a]:
                    que.append(a)
    if False in confilm:
        ans += 1

print(ans)

# Optimized solution

class UnionFind :
    def __init__(self, size) :
        self.parent = list(range(size))
        self.height = [0] * size
        self.size = [1] * size
        self.component = size

    def root(self, index) :
        if self.parent[index] == index :  # 根の場合
            return index
        rootIndex = self.root(self.parent[index])  # 葉の場合親の根を取得
        self.parent[index] = rootIndex  # 親の付け直し
        return rootIndex

    def union(self, index1, index2) :  # 結合
        root1 = self.root(index1)
        root2 = self.root(index2)

        if root1 == root2 :  # 連結されている場合
            return

        self.component -= 1  # 連結成分を減らす

        if self.height[root1] < self.height[root2] :
            self.parent[root1] = root2  # root2に結合
            self.size[root2] += self.size[root1]
        else :
            self.parent[root2] = root1  # root1に結合
            self.size[root1] += self.size[root2]
            if self.height[root1] == self.height[root2] :
                self.height[root1] += 1
        return

    def isSameRoot(self, index1, index2) :
        return self.root(index1) == self.root(index2)

    def sizeOfSameRoot(self, index) :
        return self.size[self.root(index)]

    def getComponent(self) :
        return self.component

N, M = list(map(int, input().split()))
AB = [tuple([int(a) - 1 for a in input().split()]) for _ in range(M)]

ans = 0
for i in range(M):
    tree = UnionFind(N)
    for a, b in (AB[:i] + AB[i + 1:]):
        tree.union(a, b)
    if tree.getComponent() > 1:
        ans += 1
print(ans)
# Original solution
import copy
        
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

class UnionFindPathCompression():
    def __init__(self, n:int):
        self.parents = list(range(n))
        self.rank = [1]*n
        self.size = [1]*n
        

    def find(self, x:int) -> int:
        if self.parents[x] == x:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x:int, y:int):
        px = self.find(x)
        py = self.find(y)

        if px == py:
            return
        else:
            if self.rank[px] < self.rank[py]:
                self.parents[px] = py
                self.size[py] += self.size[px]
            else:
                self.parents[py] = px
                self.size[px] += self.size[py]
                #ランクの更新
                if self.rank[px] == self.rank[py]:
                    self.rank[px] += 1


n,m = list(map(int,input().split()))
ab = [list(map(int, input().split())) for _ in range(m)]
memo = 0
for i in range(m):
    ufpc = UnionFindPathCompression(n)
    ab_copy = copy.deepcopy(ab)
    ab_copy.pop(i)
    for a,b in ab_copy:
        a,b = a-1,b-1
        ufpc.union(a,b)
    for i in range(n):
        ufpc.find(i)
    check = set(ufpc.parents)
    if len(check)==1:
        memo += 1
print((m-memo))

# Optimized solution
import copy
        
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

class UnionFindPathCompression():
    def __init__(self, n:int):
        self.parents = list(range(n))
        self.rank = [1]*n
        self.size = [1]*n
        

    def find(self, x:int) -> int:
        if self.parents[x] == x:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x:int, y:int):
        px = self.find(x)
        py = self.find(y)

        if px == py:
            return
        else:
            if self.rank[px] < self.rank[py]:
                self.parents[px] = py
                self.size[py] += self.size[px]
            else:
                self.parents[py] = px
                self.size[px] += self.size[py]
                #ランクの更新
                if self.rank[px] == self.rank[py]:
                    self.rank[px] += 1


n,m = list(map(int,input().split()))
ab = [list(map(int, input().split())) for _ in range(m)]
ans = 0
for i in range(m):
    ufpc = UnionFindPathCompression(n)
    ab_copy = copy.deepcopy(ab)
    ab_copy.pop(i)
    for a,b in ab_copy:
        a,b = a-1,b-1
        ufpc.union(a,b)
    for i in range(n):
        ufpc.find(i)
    check = set(ufpc.parents)
    if len(check) != 1:
        ans += 1
print(ans)
# Original solution
import sys
from io import StringIO
import unittest

sys.setrecursionlimit(10**5)

def dfs(u, visited, g, seq):
	visited[u] = True
	for v in g[u]:
		if visited[v] == True or not seq[u][v]:
			continue
		dfs(v, visited, g, seq)

def resolve():
	n, m = list(map(int, input().split()))
	seq = [[True]*n for _ in range(n)]
	g = [[] for _ in range(n)]
	edges = []
	ans = 0
	for _ in range(m):
		a, b = list(map(int, input().split()))
		edges.append([a-1, b-1])
	for i in range(m):
		g[edges[i][0]].append(edges[i][1])
		g[edges[i][1]].append(edges[i][0])

	for i in range(m):
		visited = [False]*n

		seq[edges[i][1]][edges[i][0]] = False
		seq[edges[i][0]][edges[i][1]] = False

		dfs(0, visited, g, seq)
		if len(visited) != visited.count(True):
			ans += 1
		seq[edges[i][1]][edges[i][0]] = True
		seq[edges[i][0]][edges[i][1]] = True
	print(ans)
resolve()

# Optimized solution
def search(u, g, visited):
	if visited[u]:
		return
	visited[u] = True
	for v in g[u]:
		search(v, g, visited)

def resolve():
	n, m = list(map(int, input().split()))
	edges = [list(map(int, input().split())) for _ in range(m)]
	ans = 0
	for i in range(m):
		g = [[] for _ in range(n)]
		for j in range(m):
			if i == j:
				continue
			a, b = edges[j]
			g[a-1].append(b-1)
			g[b-1].append(a-1)
		visited = [False]*n
		search(0, g, visited)
		if visited.count(True) != n:
			ans += 1
	print(ans)
resolve()