Harryxun/stf_run huggingface dataset:
bing=[]
for i in range(3):
  bing.append(list(map(int,input().aplit())))
import itertools as it
dic={}
bing=[[1 for i in range(3)] for j in range(3)]
for i in range(3):
    f=list(map(int,input().split()))
    for each in f:
        dic.update({each:(i,f.index(each))})
n=int(input())
for i in range(n):
    m=int(input())
    place=dic[m]
    bing[place[0]][place[1]]=0
flag=False
code="000102101112202122"
code=code+code[::-1]
code=code+"001122021120"

for i in range(8):
    code_sep=code[6*i:6*i+6]
    p=0
    for j in range(3):
        cords=code_sep[2*j:2*j+2]
        p+=bing[int(cords[0])][int(cords[1])]
    if p==0:
        flag=True
        break
    
print("yes")if flag else print("No")

### FIXED CODE ###

import itertools as it
dic={}
bing=[[0 for i in range(3)] for j in range(3)]
for i in range(3):
    f=list(map(int,input().split()))
    for each in f:
        dic.update({each:(i,f.index(each))})
n=int(input())
for i in range(n):
    m=int(input())
    if m in dic.keys():
        place=dic[m]
        bing[place[0]][place[1]]=1
flag=False
code="000102101112202122"
code=code+code[::-1]
code=code+"001122021120"

for i in range(8):
    code_sep=code[6*i:6*i+6]
    p=1
    for j in range(3):
        cords=code_sep[2*j:2*j+2]
        p*=bing[int(cords[0])][int(cords[1])]
    if p==1:
        flag=True
        break
    
print("Yes")if flag else print("No")
# -*- coding: utf-8 -*-
A,B,C = map(int, raw_input().split())
if A == B:
    print(C):
if A == C:
    print(B)
if B == C:
    print(A)


### FIXED CODE ###

# -*- coding: utf-8 -*-
A,B,C = map(int, raw_input().split())
if A == B:
    print(C)
if A == C:
    print(B)
if B == C:
    print(A)
N = int(input())
A = []
for i in range(N):
  A.append(input())

B = sorted(A, reverse=True)
max_first = B[0]
max_second = B[1]
max_third = B[2]

for i in range(N):
  if A[i] != max_first:
    print(max_first)
  elif A[i] != max_second:
    print(max_second)
  else:
    print(max_third)


### FIXED CODE ###

N = int(input())
A = []
B = []
for _ in range(N):
    temp = int(input())
    A.append(temp)
    B.append(temp)

B.sort(reverse=True)
max_first = B[0]
max_second = B[1]

for i in range(N):
    if A[i] == max_first:
        print(max_second)
    else:
        print(max_first)
N,K = map(int,input().split())
H = list(map(int,input().split()))
count = 0
for i in H:
  if h>=K:
    count = count+1
print(count)

### FIXED CODE ###

N,K = map(int,input().split())
H = list(map(int,input().split()))
count = 0
for i in H:
  if i>=K:
    count = count+1
print(count)
import math
n = int(input())
index = 2
result = math.inf
while index * index <= n:
    if n % index == 0:
        curr = (n // index) - 1
        curr += (index - 1)
        result = min(curr, result)
    index += 1
if result == math.inf:
    result = n - 1
print(result)

### FIXED CODE ###


n = int(input())
index = 2
result = 10**13
while index * index <= n:
    if n % index == 0:
        curr = (n // index) - 1
        curr += (index - 1)
        result = min(curr, result)
    index += 1
if result == 10**13:
    result = n - 1
print(result)
# -*- coding: utf-8 -*-

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

A=[0]*M
A[0]=X
D=[0]*M

s=N
for i in range(1,N):
    a=A[i-1]**2%M
    if D[a] == 1:
        s=A.index(a)
        break
    else:
        A[i]=a
        D[a]=1

if s==N:
    ans=sum(A)
else:
    A=A[:i]
    
    ans=0
    l=len(A)-s
    ans+=sum(A[:s])
    S=sum(A[s:])
    T=(N-s)//l
    ans+=T*S
    K=N-s-l*T
    ans+=sum(A[s:(s+K)])


print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-

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

A=[0]*10**5
A[0]=X
D=dict()
#A=[X]
s=N
for i in range(1,N):
    a=A[i-1]**2%M
    if a in D:
        s=A.index(a)
        break
    else:
        #A.append(a)
        A[i]=a
        D[a]=0

if s==N:
    ans=sum(A)
else:
    A=A[:i]
    Z=[0]*(len(A)+1)
    for i in range(1,len(A)+1):
        Z[i]=Z[i-1]+A[i-1]  

    ans=0
    l=len(A)-s
    #ans+=sum(A[:s])
    ans+=Z[s]
    #S=sum(A[s:])
    S=Z[len(A)]-Z[s]
    T=(N-s)//l
    ans+=T*S
    K=N-s-l*T
    #ans+=sum(A[s:(s+K)])
    ans+=Z[s+K]-Z[s]


print(ans)
K,S=map(int, input().split())
count = 0
for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x+y+z==S:
                count = count +1
print(count)

### FIXED CODE ###

#51
Haiku = str(input())
print(Haiku.replace(","," "))
import numpy as np
import math

def fuctrization(n):
    arr = []
    tmp = n
    for i in range(2,math.ceil(n**(1/2))+1):
        if tmp%i==0:
            j = 0
            while tmp%i==0:
                j += 1
                tmp //= i
            arr.append([i,j])
    if tmp != 1:
        arr.append([tmp,1])
    if arr:
        pass
    else:
        arr.append([n,1])
            
    return arr
            
        
        
n = int(input())
if n == 1:
    print(0)
else:
    arr = fuctrization(n)
    nn = 0
    for i in range(len(arr)):
        k = arr[i][1]
        nnn = 1
        while k-nnn>0:
            k -= nnn
            nnn += 1
            if k-nnn == 0:
                pass
            elif nnn != 1:
                nnn -= 1
        nn += nnn
print(nn)


### FIXED CODE ###

import numpy as np
import math

def fuctrization(n):
    arr = []
    tmp = n
    for i in range(2,math.ceil(n**(1/2))+1):
        if tmp%i==0:
            j = 0
            while tmp%i==0:
                j += 1
                tmp //= i
            arr.append([i,j])
    if tmp != 1:
        arr.append([tmp,1])
    if arr:
        pass
    else:
        arr.append([n,1])
            
    return arr
            
        
        
n = int(input())
if n == 1:
    print(0)
else:
    arr = fuctrization(n)
    nn = 0
    for i in range(len(arr)):
        k = arr[i][1]
        nnn = 1
        while k-nnn>=0:
            k -= nnn
            nnn += 1
            nn +=1
    print(nn)
# coding:utf-8
import sys
import datetime

H1 = int(sys.stdin.readline())
M1 = int(sys.stdin.readline())
H2 = int(sys.stdin.readline())
M2 = int(sys.stdin.readline())
K = int(sys.stdin.readline())


while not 0 <= H1 < 23 and 0 <= M1 < 59 and 0 <= H2 < 23 and 0 <= M2 < 59:
    H1 = int(sys.stdin.readline())
    M1 = int(sys.stdin.readline())
    H2 = int(sys.stdin.readline())
    M2 = int(sys.stdin.readline())
    K = int(sys.stdin.readline())

if M2 >= M1:
    a = (H2 - H1) * 60 + M2 - M1
    print(a - K)
if M2 <= M1:
    b = (H2 - H1) * 60 + M1 - M2
    print(b - K)

### FIXED CODE ###

import sys
readline = sys.stdin.buffer.readline

h1, m1, h2, m2, k = map(int, readline().split())
print(60 * (h2 - h1) + m2 - m1 - k)
s, t = input().split()
a, b = map(int, input().split())
u = input()

if s == u:
    print(f'{a-1} {b}')
else:
    print(f'{a} {b-1}')


### FIXED CODE ###

s, t = input().split()
a, b = map(int, input().split())
u = input()

if s == u:
    print(a-1, b)
else:
    print(a, b-1)
n,a,b = map(int, input().split())
sum = 0
for i in range(1,n+1):
  str(i)
  if a< str(i) and str(i)<b :
    sum += i
print(sum)

### FIXED CODE ###

n,a,b = map(int, input().split())
total = 0
for i in range(1,n+1):
  array = list(map(int,str(i)))
  if a<= sum(array) and sum(array)<=b :
    total += i
print(total)
def flatten(N, A):
    # get lcm
    lcm_of_A = lcm(A)
    # get sum of lcm/values
    ans = 54
    modulo_value = 10000000007
    return ans % modulo_value
 
 
if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    print(flatten(N, A))

### FIXED CODE ###

"""
the condition is straightforward.
each element of A and B must multiply to the same value.
to minimise the total of B, simply make that value as small
as possible (since A is fixed).

lcm(2, 3, 4) = 12
therefore B is
12/2, 12/3, 12/4
and the sum of B is
12/2 + 12/3 + 12/4

lcd of a list is loop: lcd(partial, new_value)
lcd(a, b) = ab / gcd(a, b)
"""

from fractions import gcd


def lcm(list_ints):
    lcm_ongoing = 1
    for val in list_ints:
        lcm_ongoing = val*lcm_ongoing//gcd(val, lcm_ongoing)
    return lcm_ongoing


def flatten(N, A):
    # get lcm
    lcm_of_A = lcm(A)
    # get sum of lcm/values
    ans = sum(lcm_of_A//value for value in A)
    modulo_value = int(int(10e8)+7)
    return ans % modulo_value


if __name__ == "__main__":
    test1 = \
"""3
2 3 4"""
    test2 = \
"""5
12 12 12 12 12"""
    test3 = \
"""3
1000000 999999 999998"""
    test = test3
    # N = int(test.split("\n")[0])
    # A = list(map(int, test.split("\n")[1].split()))
    N = int(input())
    A = list(map(int, input().split()))
    print(flatten(N, A))
import bisect

H, W, M = map(int,input().split())
hw = [list(map(int,input().split())) for _ in range(M)]
hw.sort()

rows, columns = [0]*H, [0]*W
for h, w in hw:
    rows[h-1] += 1
    columns[w-1] += 1
max_r, max_c = max(rows), max(columns)

argmax_r, argmax_c = [], []
for i in range(H):
    if max_r == rows[i]:
        argmax_r.append(i)

for i in range(W):
    if max_c == columns[i]:
        argmax_c.append(i)

for r in argmax_r:
    for c in argmax_c:
        idx = bisect.bisect_left(hw, [r+1, c+1])
        if hw[idx] != [r+1,c+1]:
            print(max_r + max_c)
            exit()

print(max_r + max_c - 1)

### FIXED CODE ###

import bisect

H, W, M = map(int,input().split())
hw = [list(map(int,input().split())) for _ in range(M)]
hw.sort()

rows, columns = [0]*H, [0]*W
for h, w in hw:
    rows[h-1] += 1
    columns[w-1] += 1
max_r, max_c = max(rows), max(columns)

argmax_r, argmax_c = [], []
for i in range(H):
    if max_r == rows[i]:
        argmax_r.append(i)

for i in range(W):
    if max_c == columns[i]:
        argmax_c.append(i)

for r in argmax_r:
    for c in argmax_c:
        idx = bisect.bisect_left(hw, [r+1, c+1])
        if idx == M or hw[idx] != [r+1,c+1]:
            print(max_r + max_c)
            exit()

print(max_r + max_c - 1)
n = int(input())
a = list(map(int, input().split()))
q = int(input())
xy = [map(int, input().split()) for _ in range(q)]
b, c = [list(i) for i in zip(*xy)]

stuck_b = []
stuck_c = []
stuck_sum = []

sum = 0

for cnt_q in range(q):
    sum = 0
    if stuck_b[cnt_q] == b[cnt_q] and stuck_c[cnt_q] == c[cnt_q]:
        print(stuck_sum[cnt_q])
    else:
        for cnt_n in range(n):
            if a[cnt_n] == b[cnt_q]:
                a[cnt_n] = c[cnt_q]
        for num in range(n):
            sum += a[num]
        print(sum)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
q = int(input())
xy = [map(int, input().split()) for _ in range(q)]
b, c = [list(i) for i in zip(*xy)]

ans = 0

sum_all = 0
for cnt in range(n):
    sum_all += a[cnt]

a = sorted(a)
list_a_num = [0]*(10**5 + 1)
for cnt in range(n):
    list_a_num[a[cnt]] += 1

for cnt in range(q):
    sum_all += (c[cnt] - b[cnt]) * list_a_num[b[cnt]]
    list_a_num[c[cnt]] += list_a_num[b[cnt]]
    list_a_num[b[cnt]] = 0
    print(sum_all)
n,d=map(int, readline().rstrip().split())
m=[]
for _ in range(n):
    arr=list(map(int, readline().rstrip().split()))
    m.append(arr)
ans=0
for i in range(n-1):
    for j in range(i+1,n):
        a = 0
        for k in range(d):
            a += (m[i][k] - m[j][k])**2
        x = int(a**(1/2))
        if x*2 == a:
            ans+=1
print(ans)
        
        

### FIXED CODE ###

n,d=map(int, input().rstrip().split())
m=[]
for _ in range(n):
    arr=list(map(int, input().rstrip().split()))
    m.append(arr)
ans=0
for i in range(n-1):
    for j in range(i+1,n):
        a = 0
        for k in range(d):
            a += (m[i][k] - m[j][k])**2
        x = int(a**(1/2))
        if x**2 == a:
            ans+=1
print(ans)
k = int(input())
s = int(input())
counter = 0

for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if s == x+y+z:
                counter += 1
                
print(counter)

### FIXED CODE ###

k,s = map(int,input().split())
counter = 0

for x in range(k+1):
    if s-x > 2*k:
        continue
    for y in range(k+1):
        if s-x-y > k or s-x-y < 0:
            continue
        else:
            counter += 1
            
print(counter)
import sys
S = sys.readline()
if S[2] == S[3] and S[4] == S[5]:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

import sys
S = sys.stdin.readline()
if S[2] == S[3] and S[4] == S[5]:
  print('Yes')
else:
  print('No')
s = input()
S = s.split('/')
ymd = int(''.join(S)) 
if ymd <= 20190419:
  print(Heisei)
else:
  print(TDB)

### FIXED CODE ###

a = list(map(int,input().split("/")))
if a[1] > 4:
  print("TBD")
else:
  print("Heisei")
import sys
W,H,N=map(int,input().split())
wide=[0,W]
height=[0,H]
# white sphere calculate
for i in range(N):
    x,y,a=map(int,input().split())
    if a==1:
        wide[0]=max(wide[0],x)
    elif a==2:
        wide[1]=min(wide[1],x)
    elif a==3:
        height[0]=max(height[0],y)
    elif a==4:
        height[1]=min(height[1],y)
w_len=wide[1]-wide[0]
h_len=height[1]-height[0]
s=w_len*h_len
if h_len<0 or w_len<0:
    print(0)
else:
    print(s)

### FIXED CODE ###

a,b,c=map(int,input().split())
if(a+b==c or a+c==b or b+c==a):
    print("Yes")
else:
    print("No")
import heapq

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

queries = []
for i in range(m):
    q = list(map(int, input().split()))
    queries.append(q)
queries.sort(key=lambda x: x[1])
queries.reverse()

ans = 0
pos = 0
for q in queries:
    b, c = q
    if cards[pos + b - 1] < c:
        # print('a')
        pos = pos + b
        ans += c * b
        if pos == n:
            break
    else:
        for i in range(b):
            if cards[pos + i] < c:
                # print('b')
                ans += c
            else:
                # print('c')
                pos += i
                for j in range(pos, n):
                    ans += cards[j]

                pos = n
                break
        break

if pos < n:
    for j in range(pos, n):
        ans += cards[j]

print(ans)



### FIXED CODE ###

import heapq

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

queries = []
for i in range(m):
    q = list(map(int, input().split()))
    queries.append(q)
queries.sort(key=lambda x: x[1])
queries.reverse()

ans = 0
pos = 0
for q in queries:
    b, c = q
    if cards[min(pos+b-1, n-1)] < c:
        # print('a')
        pos = pos + b
        ans += c * (b - max(0, pos-n))
        if pos >= n:
            break
    else:
        for i in range(b):
            if cards[pos+i] < c:
                # print('b')
                ans += c
            else:
                # print('c')
                pos += i
                for j in range(pos, n):
                    ans += cards[j]

                pos = n
                break
        break

if pos < n:
    for j in range(pos, n):
        ans += cards[j]

print(ans)
x,y = map(int,input())
print(x+y//2)

### FIXED CODE ###

x,y = map(int,input().split())
print(x+y//2)
x , n = map(int , input().split())
if n != 0:
    p = list(map(int , input().split()))

ans = x

for i in range(100):
    tmp1 = x - i
    tmp2 = x + i
    if not tmp1 in p:
        ans = tmp1
        break
    elif not tmp2 in p:
        ans = tmp2
        break

print(ans)

### FIXED CODE ###

x , n = map(int , input().split())
if n == 0:
    print(x)
    exit()
p = list(map(int , input().split()))

ans = x

for i in range(101):
    tmp1 = x - i
    tmp2 = x + i
    if not tmp1 in p:
        ans = tmp1
        break
    elif not tmp2 in p:
        ans = tmp2
        break

print(ans)
a = map(int,input().split())

if a%2 == 0:
    print(a)
else:
    print(a*2)


### FIXED CODE ###

a = list(map(int,input().split()))
b = int(a[0])
if b %2 == 0:
    print(b)
else:
    print(b*2)
i = list()
for x in range(2):
  i.append(map(int,input().split()))
print(i[0][0]-i[1][0])*(i[0][1]-i[1][1])

### FIXED CODE ###

i = list()
for x in range(2):
  i.append([int(x) for x in input().split()])
print((i[0][0]-i[1][0])*(i[0][1]-i[1][1]))
s = input()
ans = 0
for S in s:
  if S == "A":
    ans += 1
  elif S == "G":
    ans += 1
  elif S == "T":
    ans += 1
  elif S == "C":
    ans += 1
  else:
    ans = 0
    
print(ans)
s = input()
ans = 0
for S in s:
  if S == "A":
    ans += 1
  elif S == "G":
    ans += 1
  elif S == "T":
    ans += 1
  elif S == "C":
    ans += 1
  else:
    ans = 0
    
print(ans)


### FIXED CODE ###

s = input()
ans = 0
m = 0
for S in s:
  if S in "A":
    ans += 1
  elif S in "G":
    ans += 1
  elif S in "T":
    ans += 1
  elif S in "C":
    ans += 1
  else:
    ans = 0
  m = max(m,ans)
print(m)
H, W = map(lambda x: int(x)+4, input().split())
Ch, Cw = map(int, input().split())
Dh, Dw = map(int, input().split())

grid = '#' * W * 2
for _ in range(H-4):
  grid += '##' + input() + '##'
grid += '#' * W * 2

def bfs(start):
  INF = 10 ** 9
  dist = [INF] * (H*W)
  magic = [INF] * (H*W)
  dist[start] = 0
  magic[start] = 0
  q = deque([start])
  move_list = [-1, 1, W, -W]
  mag_list1 = [-2*W, -W, 0, W, 2*W]
  mag_listW = [-2, -1, 0, 1, 2]
  while q:
    v = q.popleft()
    dv = dist[v]
    mv = magc[v]
    magic_list = []
    for move in move_list:
      w = v + move
      if grid[w] == '#':
        magic_list.append(move)
      dw = dv + 1
      if dw >= dist[w]:
        continue
      dist[w] = dw
      q.append(w)
    for move in magic_list:
      if abs(move) == 1:
        for mag in mag_list1:
          w = v + 2*move + mag
          if grid[w] == '#':
            continue
          mw = mv + 1
          if mw >= magic[w]:
            continue
          magic[w] = mw
          q.append(w)
      else:
        for mag in mag_list2:
          w = v + 2*move + mag
          if grid[w] == '#':
            continue
          mw = mv + 1
          if mw >= magic[w]:
            continue
          magic[w] = mw
          q.append(w)
  return magic

print(bfs(W*(2+Ch-1)+2+Cw)[W*(2+Dh-1)+2+Dw])

### FIXED CODE ###

from collections import deque

H, W = map(lambda x: int(x)+4, input().split())
Ch, Cw = map(int, input().split())
Dh, Dw = map(int, input().split())

grid = '#' * W * 2
for _ in range(H-4):
  grid += '##' + input() + '##'
grid += '#' * W * 2

magic_list = []
for i in range(5):
  for j in range(5):
    if (i, j) in [(2, 2), (1, 2), (2, 1), (2, 3), (3, 2)]:
      continue
    else:
      magic_list.append(i-2 + W*(j-2))

move_list = [-1, 1, W, -W]

def bfs(start):
  INF = 10 ** 9
  dist = [INF] * (H*W)
  dist[start] = 0
  q = deque([start])
  while q:
    v = q.popleft()
    dv = dist[v]
    for move in move_list:
      w = v + move
      if grid[w] == '#':
        continue
      dw = dv
      if dw >= dist[w]:
        continue
      dist[w] = dw
      q.appendleft(w)
    for magic in magic_list:
      w = v + magic
      if grid[w] == '#':
        continue
      dw = dv + 1
      if dw >= dist[w]:
        continue
      dist[w] = dw
      q.append(w)
  return dist

ans = bfs( (Ch+1)*W + Cw+1 )[(Dh+1)*W + Dw+1]

if ans == 10**9:
  print(-1)
else:
  print(ans)
X,Y,Z,K=map(int,input().split())
A=sorted(list(map(int,input().split())))[::-1]
B=sorted(list(map(int,input().split())))[::-1]
C=sorted(list(map(int,input().split())))[::-1]
ans=[0]*(K**3)
ind=0
for a in range(len(A)):
  for b in range(len(B)):
    for c in range(len(C)):
      if (a+1)*(b+1)*(c+1)>K:
        break
      ans[ind]=A[a]+B[b]+C[c]
      ind+=1

ans=sorted(ans)[::-1]
for i in range(K):
  print(ans[i])


### FIXED CODE ###

X,Y,Z,K=map(int,input().split())
A=sorted(list(map(int,input().split())))[::-1]
B=sorted(list(map(int,input().split())))[::-1]
C=sorted(list(map(int,input().split())))[::-1]
ans=[]
for a in range(len(A)):
  for b in range(len(B)):
    for c in range(len(C)):
      if (a+1)*(b+1)*(c+1)>K:
        break
      ans.append(A[a]+B[b]+C[c])

ans=sorted(ans)[::-1]
for i in range(min(K,len(ans))):
  print(ans[i])
n, x, m = map(int,input().split())
ans = x
num = 0
l = [0]*max(n,10**6)
lis = [-1]*m
l[0] = x
lis[x] = num
for i in range(1,n):
    x = (x*x)%m
    num += 1
    if lis[x]!=-1:
        a = (n-i)//(i-lis[x])
        b = (n-i)%(i-lis[x])
        ans += a * sum(l[lis[x]:i])
        break
    l[i] = x
    lis[x] = i
    ans += x
for i in range(lis[x],lis[x]+b):
    ans += l[i]
print(ans)

### FIXED CODE ###

n, x, m = map(int,input().split())
ans = x
num = 0
l = [0]*m
lis = [-1]*m
l[0] = x
lis[x] = num
for i in range(1,n):
    x = (x*x)%m
    num += 1
    if lis[x]!=-1:
        a = (n-i)//(i-lis[x])
        b = (n-i)%(i-lis[x])
        ans += a * sum(l[lis[x]:i])
        for j in range(lis[x],lis[x]+b):
            ans += l[j]
        break
    l[i] = x
    lis[x] = i
    ans += x
print(ans)
class UnionFind:
  def __init__(self, n):
    self.parents = list(range(n))
    self.ranks = [1 for _ in range(n)]
  def parent(self, x):
    if x == self.parents[x]:
      return x
    else:
      p = self.parent(self.parents[x])
      self.parents[x] = p
      return p
  def union(self, x, y):
    host = x if self.ranks[x] < self.ranks[y] else y
    guest = x+y-host
    self.ranks[host] += self.ranks[guest]
    self.parents[self.parent(guest)] = host
  def find(self, x, y):
    return self.parent(x)==self.parent(y)
  def numtrees(self):
    return len(set(self.parents))

N, M = map(int, input().split())
E = []
for _ in range(M):
  a, b = map(int, input().split())
  E.append((a-1, b-1))
ans = 0
r = 0
while r < M:
  uf = UnionFind(N)
  i = 0
  while i < M:
    if i != r:
      a, b = E[i]
      uf.union(a, b)
    i += 1
  i = 0
  while i < M:
    _ = uf.parent(i)
    i += 1
  if uf.numtrees() > 1:
    ans += 1
  r += 1
print(ans)

### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = 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

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

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

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

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

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

N, M = map(int, input().split())
E = []
for _ in range(M):
  a, b = map(int, input().split())
  E.append((a-1, b-1))
ans = 0
r = 0
while r < M:
  uf = UnionFind(N)
  i = 0
  while i < M:
    if i != r:
      a, b = E[i]
      uf.union(a, b)
    i += 1
  i = 0
  while i < N:
    _ = uf.find(i)
    i += 1
  if uf.group_count() > 1:
    ans += 1
  r += 1
print(ans)