Harryxun/stf_run huggingface dataset:
a ,b= map(int,input().split())
aaa = [list(map(int,input().split())) for i in range(b*2)]
 
s = {i + 1 for i in range(0,a)}

for i in range(1,a+1,2):
    for k in aaa[i]:
        s.discard(k)

print(len(s))

### FIXED CODE ###

a,b = map(int,input().split())
aaa = [list(map(int,input().split())) for i in range(b*2)]

c = set()
e = set()
for i in range(1,len(aaa),2):
  for k in aaa[i]:
     c.add(k)
    
print(a - len(c))
def solve(values,hp=0,vp=0,stamp=0):
	if hp==0:
	if hp!=0 and values[hp-1][vp]==values[hp][vp]:
		values[hp-1][vp]=stamp
		solve(values,hp-1,vp,stamp)
	if hp!=len(values) and values[hp+1][vp]==values[hp][vp]:
		values[hp+1][vp]=stamp
		solve(values,hp-1,vp,stamp)
	if vp!=0 and values[hp][vp-1]==values[hp][vp]:
		values[hp][vp]=stamp
		solve(values,hp-1,vp,stamp)
	if vp!=len(values[hp] and) values[hp][vp+1]==values[hp][vp]:
		values[hp][vp+1]=stamp
		solve(values,hp-1,vp,stamp)
	values[hp][vp]=stamp

	for i in range(values):
		for j in range(values[i]):
			if values[i][j] in ['@','#','*']:
				stamp+=1
				solve(values,i,j,stamp)
	return stamp


H,W = raw_input().split(' ')
values = list()
for _ in range(H):
	values.append(raw_input().split())
print(solve(values))

### FIXED CODE ###

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

import sys
sys.setrecursionlimit(10**6)

def search(field,hp,vp,item):
	if not (0<=hp<len(field)): return
	if not (0<=vp<len(field[hp])): return
	if item!=field[hp][vp]: return
	field[hp][vp]=True
	for dh,dv in [[0,1],[0,-1],[1,0],[-1,0]]:
		search(field,hp+dh,vp+dv,item)
#	search(field,hp-1,vp,item)
#	search(field,hp+1,vp,item)
#	search(field,hp,vp-1,item)
#	search(field,hp,vp+1,item)

def solve(field):
	count,valid_items=0,set(['@','#','*'])
	for i in range(len(field)):
		for j in range(len(field[i])):
			if field[i][j] in valid_items:
				search(field,i,j,field[i][j])
				count+=1
	return count

def main():
	line = input().strip()
	while line!='0 0':
		H,W = list(map(int,line.split(' ')))
		field = list()
		for _ in range(H):
			field.append(list(input().strip()))
		print(solve(field))
		line = input().strip()

if __name__=='__main__':
	main()
n,d= map(int, input().split())
x,y=[int(input()) for i in range(n)]

def f(a,b):
  s=0
  for i in range(N)
  　　if (a[i]**2 + b[i]**2)**(1/2)<= d:
     　　s=s+1
  return s

print(f(x,y))

### FIXED CODE ###

N,D = map(int, input().split())
XY = [map(int, input().split()) for _ in range(N)]
X,Y = [list(i) for i in zip(*XY)]

s=0
for i in range (N):
  if X[i]*X[i]+Y[i]*Y[i]<=D*D:
    s=s+1
print(s)
import math
N=int(input())
def hantei(u):
  if u==1:
    return 1
  for i in range(1,u+1):
    if (1/2)*i**2+(1/2)*i>u:
      return int(i-1)
    else:
      continue
   
a=[0]*int(N)
for i in range(2,N+1):
  while N%i==0:
    N=N//i
    a[i-1]=a[i-1]+1
c=0
for t in range(len(a)):
  if a[t]!=0:
    c+=hantei(a[t])
print(c)    

### FIXED CODE ###

import math
N=int(input())
def hantei(u):
  if u==1:
    return 1
  for i in range(1,u+1):
    if (1/2)*i**2+(1/2)*i>u:
      return int(i-1)
    else:
      continue
   
a=[0]*int(math.sqrt(N))
for i in range(2,int(math.sqrt(N))+1):
  while N%i==0:
    N=N//i
    a[i-1]=a[i-1]+1
c=0
if N!=1:
  c+=1
for t in range(len(a)):
  if a[t]!=0:
    c+=hantei(a[t])
print(c)
x = int(input())
ans = []
for i in range(2, x):
    for l in range(2, x):
        if i ** l <= x:
            ans.append(i ** l)
        if i ** l > x:
            break

print(int(ans[len(ans)-1]))




### FIXED CODE ###

x = int(input())
ans = []
for i in range(1, x+2):
    for l in range(2, x+2):
        if i ** l <= x:
            ans.append(i ** l)
        if i ** l > x:
            break
            

ans.sort()
print(ans[len(ans)-1])
n=int(input())
s=[]
d=[]
i=0
while i!=n:
    s=list(map(int,input().split()))
    d.append(s)
    i+=1
#print(d)
i=0
f=[]
s=[]
j=0
try:
    while i!=n:
        while j!=n:
            if i!=j:
                f.append(d[i][0]-d[j][0])
                f.append(d[i][1] - d[j][1])
                s.append(f)
                f=[]
    
            j += 1
        i+=1
        j=0
except:
    break

#print(s)
i=0
f=[]
while i!=len(s):
    f.append(s.count(s[i]))
    i+=1
#print(f)
print(int(n-max(f)))


### FIXED CODE ###

n=int(input())
s=[]
d=[]
i=0
while i!=n:
    s=list(map(int,input().split()))
    d.append(s)
    i+=1
#print(d)
i=0
f=[]
s=[]
j=0
while i!=n:
    while j!=n:
        if i!=j:
            f.append(d[i][0]-d[j][0])
            f.append(d[i][1] - d[j][1])
            s.append(f)
            f=[]

        j += 1
    i+=1
    j=0


#print(s)
i=0
f=[]
while i!=len(s):
    f.append(s.count(s[i]))
    i+=1
#print(f)
try:
    print(int(n-max(f)))
except:
    print(1)
n, m, k = list(map(int, input().split()))

x = pow(m-1, n-k-1, 998244353)
c = m * ((m-1) ** k)

s = c


for i in range(1, k+1):
    c = c * (n-i) // (i * (m-1))
    s += c 

print((s * x) % 998244353)


### FIXED CODE ###

import math

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

MOD=998244353

fact = [0] * (n+1)
inv = [0] * (n+1)
factinv = [0] * (n+1)

fact[0]=fact[1]=1
inv[1]=1
factinv[0]=factinv[1]=1

for i in range(2,n+1):
    fact[i] = fact[i-1] * i % MOD
    inv[i] = MOD - (( inv[MOD % i] *  (MOD // i)) % MOD )
    factinv[i] = factinv[i-1] * inv[i] % MOD

def cbn(n, k, fact, factinv, MOD):
    return fact[n] * factinv[n-k] * factinv[k] % MOD

def power(x, n, MOD):
    if n == 0:
        return 1
    elif n % 2 == 0:
        return power(x*x % MOD , n // 2, MOD) % MOD
    else:
        return x * power(x * x % MOD, n // 2, MOD) % MOD

s = 0
for i in range(k+1):
    s += cbn(n-1, i, fact, factinv, MOD) * m * power(m-1, n-1-i, MOD)

print(s % MOD)
# coding: utf-8
from sys import stdin
import sys, math
import numpy as np

def lcm(x,y):
    return((x*y) // math.gcd(x,y))

def main():
    a,b,c,d = [int(x) for x in stdin.readline().rstrip().split()]
    #print(a, b, c, d)
    #bまでで3で割り切れる数
    three_all = b // c
    #a-1までで3で割り切れる数
    three_less = (a-1) // c
    three_range = three_all - three_less
    
    two_all = b // d
    two_less = (a-1) // d
    two_range = two_all - two_less
    
    z = lcm(c,d)
    six_all = b // z
    six_less = (a-1) // z
    six_range = six_all - six_less
    
    num = three_range + two_range - six_range
    
    ans = b-a+1-num
    print(ans)
    
    return(ans)

if __name__ == '__main__':
    _ = main()

    




### FIXED CODE ###

# coding: utf-8
from sys import stdin
import sys, fractions
import numpy as np

def lcm(x,y):
    return((x*y) // fractions.gcd(x,y))


a,b,c,d = [int(x) for x in stdin.readline().rstrip().split()]
#print(a, b, c, d)
#bまでで3で割り切れる数
three_all = b // c
#a-1までで3で割り切れる数
three_less = (a-1) // c
three_range = three_all - three_less
    
two_all = b // d
two_less = (a-1) // d
two_range = two_all - two_less
    
z = lcm(c,d)
six_all = b // z
six_less = (a-1) // z
six_range = six_all - six_less
    
num = three_range + two_range - six_range
    
ans = b-a+1-num
print(ans)
x,y=map(int,input().split())
    a1=-1
    b1=-1
    c1=-1
    for a in range(0,x+1):
    	for b in range(0,x+1-a):
    		c=x-a-b
    		if 10000*a+5000*b+1000*c==y:
    			a1=a
    			b1=b
    			c1=c
    print(a1,b1,c1)

### FIXED CODE ###

x,y=map(int,input().split())
a1=-1
b1=-1
c1=-1
for a in range(0,x+1):
    for b in range(0,x+1-a):
        c=x-a-b
        if 10000*a+5000*b+1000*c==y:
            a1=a
            b1=b
            c1=c
print(a1,b1,c1)
n=int(input())
a=tuple(map(int,input().split()))

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

dp=[]
for i in range(n):
    aa=list(a)
    del aa[i]
    dp.append(gcd(*aa))

print(max(dp))


### FIXED CODE ###

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

def gcd(a,b):
    if a == 0:
        return b
    if b == 0:
        return a
    r = 1
    while r > 0:
        r = a % b
        a = b
        b = r
    return a

l=[0]*(n+1)
r=[0]*(n+1)
for i in range(n):
    l[i+1]=gcd(l[i],a[i])
for i in range(n,0,-1):
    r[i-1]=gcd(r[i],a[i-1])

m=[]
for i in range(n):
    m.append(gcd(l[i],r[i+1]))

print(max(m))
a,b,c = map(int,input().split())
k = int(input())
ans = max(a,b,c)
for i in range(k):
  ans = ans + ans
print(ans+min(a,b,c)+a+b+c-max(a,b,c)-min(a,b,c)

### FIXED CODE ###

a,b,c = map(int,input().split())
k = int(input())
ans = max(a,b,c)
for i in range(k):
  ans = ans + ans
print(ans+min(a,b,c)+a+b+c-max(a,b,c)-min(a,b,c))
#ABC150_D

from fractions import gcd
N,M=map(int,input().split())
A=list(map(int,input().split()))
lcm=a[0]//2

for x in A:
    x//=2
    g=gcd(lcm,x)
    
    if (lcm//g)%2!=(x//g)%2:
        print(0)
        exit()
    
    lcm=lcm*x//g
print((M//lcm+1)//2)

### FIXED CODE ###

#ABC150_D

from fractions import gcd
N,M=map(int,input().split())
A=list(map(int,input().split()))
lcm=A[0]//2

for x in A:
    x//=2
    g=gcd(lcm,x)
    
    if (lcm//g)%2!=(x//g)%2:
        print(0)
        exit()
    
    lcm=lcm*x//g
print((M//lcm+1)//2)
N, M, C = (int(x) for x in raw_input().split())
B = [int(x) for x in raw_input().split()]
A = [[int(x) for x in raw_input().split()] for i in xrange(N)]
result = 0
for i in xrange(N):
  cur_sum = C
  for a, b in izip(A, B):
    cur_sum += a * b
  if cur_sum > 0:
    result += 1
print(result)

### FIXED CODE ###

from itertools import izip

N, M, C = (int(x) for x in raw_input().split())
B = [int(x) for x in raw_input().split()]
A = [[int(x) for x in raw_input().split()] for i in xrange(N)]
result = 0
for i in xrange(N):
  cur_sum = C
  for a, b in izip(A[i], B):
    cur_sum += a * b
  if cur_sum > 0:
    result += 1
print(result)
import math

n=int(input())
alist = [int(i) for i in input().split()]
alist=sorted(alist)

keta=math.floor(math.log2(alist[-1]))+1
#print(math.log2(alist[-1]), keta)
zeros=[0]*keta
ones=[0]*keta

for al in alist:
    kaz2=bin(al)[2:]
    kaz2=(keta-len(kaz2))*'0'+kaz2
    #print(kaz2)
    for i in range(keta):
        if kaz2[i]=='1':
            ones[i]+=1
        else:
            zeros[i]+=1

#print(ones)
#print(zeros)
answer=0
for i in range(keta):
    tas=ones[-i-1]*zeros[-i-1]
    tas*=((2**i)%(10**9+7))
    answer+=tas%(10**9+7)

print(answer%(10**9+7))

### FIXED CODE ###

import math

n=int(input())
alist = [int(i) for i in input().split()]
alist=sorted(alist)

keta=math.floor(math.log(max(alist[-1],1), 2))+1
zeros=[0]*keta
ones=[0]*keta

for al in alist:
    kaz2=bin(al)[2:]
    kaz2=(keta-len(kaz2))*'0'+kaz2
    for i in range(keta):
        if kaz2[i]=='1':
            ones[i]+=1
        else:
            zeros[i]+=1

answer=0
for i in range(keta):
    tas=ones[-i-1]*zeros[-i-1]
    tas*=((2**i)%(10**9+7))
    answer+=tas%(10**9+7)

print(answer%(10**9+7))
n,m=map(int,input().split())
r={}
for _ in range(m):
  a,b=map(int,input().split())
  a,b=a-1,b-1
  if a not in r: r[a]=[]
  r[a].append(b)
  if b not in r: r[b]=[]
  r[b].append(a)

ans = {0:0}
steps = [-1]*n
steps[0]=0
def setroot(i,step):
  newroom = [v for v in r[i] if steps[v]<0 or steps[v]>step]
  #print(i,newroom)
  if len(newroom)>0:
    for v in newroom:ans[v]=i;steps[v]=step
    for v in newroom:setroot(v,step+1)
setroot(0,0)
#print(r)
#print(steps)
if len(ans) == n:
  print('Yes')
  for i in range(1,n):
    if i in ans:
      print(ans[i]+1)
else:
  print('No')
    
mod = 1000000007

n = int(input())
fishes = {}
for _ in range(n):
  a,b=map(int,input().split())
  if b == 0: r = 10**10
  else:
    r = round(a/b,10)
  if r not in fishes:fishes[r]=0
  fishes[r]+=1
for 
  if 
  


### FIXED CODE ###

f=lambda:map(int,input().split())
n,m=f()
g=[[] for _ in range(n)]
for _ in range(m):
  a,b=f()
  g[a-1]+=[b-1]
  g[b-1]+=[a-1]
p=[0]*n
from collections import*
q=deque([0])
while q:
  v=q.popleft()
  for c in g[v]:
    if p[c]<1: p[c]=v+1; q.append(c)
if 0 in p: print('No')
else: print('Yes',*p[1:],sep='\n')
N,A,B = map(int,input().split())

a = ""

blue = 'b'*A
red = 'r'*B
cnt = 0
while cnt<1000:
    a+=blue
    cnt+=1
    a+=red
    cnt+=1

target = a[0:N]
print(target)
num = target.count('b')
print(num)

### FIXED CODE ###

N,A,B = map(int,input().split())
C = A+B

ans1 = N//C*A
if N%C > A:
    ans2 = A
else:
    ans2 = N%C

print(ans1+ans2)
from numba import njit

@njit(parallel=True)
def solve(A):
    ans = [0] * (N + 1)
    for j in range(K):
        ans = [0] * (N + 1)
        for i in range(N):
            L = max(0, i - A[i])
            R = min(N, i + A[i] + 1)
            ans[L] += 1
            ans[R] -= 1
        for i in range(1, N + 1):
            ans[i] += ans[i - 1]
        issame = True
        for i in range(N):
            if i != 0:
                if ans[i - 1] != N or ans[i - 1] != ans[i]:
                    issame = False
            A[i] = ans[i]
        if issame:
            break
    for i in range(N):
        print(ans[i], end=' ')

N, K = map(int, input().split())
A = list(map(int, input().split()))

solve(A)

### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))

ans = [0] * (N+1)

for j in range(K):
    ans = [0] * (N+1)
    for i in range(N):
        L = max(0, i-A[i])
        R = min(N, i+A[i]+1)
        ans[L] += 1
        ans[R] -= 1
    for i in range(1, N+1):
        ans[i] += ans[i-1]
    issame = True
    for i in range(N):
        if i != 0:
            if ans[i-1] != N or ans[i-1] != ans[i]:
                issame = False
        A[i] = ans[i]
    if issame:
        break

for i in range(N):
    print(ans[i], end=' ')
N=int(input())
import math


#hoge=[[108]]

#x=[3,5,7,11,13,17,19]
#a=[pow(2,3)*i for i in x]

x=[5,7]
b=[[pow(3,3)*i for i in x]]

#x=[5,7,11,13,17,19,23,29,31]
#c=[2*3*i for i in x]

#x=[7,11,13,17,19]
#d=[2*5*i for i in x]

#x=[11,13]
#e=[2*7*i for i in x]

x=[7,11,13]
f=[3*5*i for i in x]

b.append(f)



x=[]
for v in b:
  for item in v:
    x.append(item)


x.sort()
import numpy as np
X=[N-x[i] for i in range(len(x))]
XX=np.where(np.array(X) < 0) 
if N!=1:
  print(XX[0][0])
if N==1:
  print(0)

### FIXED CODE ###

import numpy as np
N=int(input())
x=[105, 135, 165, 189, 195]

X=[N-x[i] for i in range(len(x))]
XX=np.where(np.array(X) < 0) 
if N<195:
  print(XX[0][0])
else:
  print(5)
import math

r = raw_input()
l = math.pi*2*r
s = math.pi*r**2 
print'%f %f' % (l, s) 

### FIXED CODE ###

import math
r = float(raw_input())
l = math.pi*2*r
s = math.pi*r**2
print'%f %f' % (s, l)
N,M = map(int,input().split())
cnt = 0
lists = []
kaidan = list(range(N+1))
ans = []
for i in range(M):
    a = int(input())
    lists.append(a)

def dfs(i):
    if i == N:
        return cnt + 1
    
    if i > N:
        return False

    if i in lists:
        return False
    
    if dfs(i+1):
        return dfs(i+1)
    
    if dfs(i+2):
        return dfs(i+2)

    return False

m = dfs(0)
print(m+m)

### FIXED CODE ###

N, M = map(int, input().split())
a = set([int(input()) for _ in range(M)])
INF = 1000000007

dp = [0] * (N + 1)
dp[0] = 1
if 1 not in a:
	dp[1] = 1
else:
	dp[1] = 0
for i in range(2, N + 1):
	if i in a:
		continue
	dp[i] = dp[i - 1] + dp[i - 2]
	dp[i] %= INF

print(dp[N])
N, A = [int(x) for x in input().split()]
X = [int(x) for x in input().split()]
# mat = {}
def dp(i, x):
  if i == N:
    if len(x) and sum(x) == A * len(x):
      return 1
    else:
      return 0
  elif len(x) and (i, sum(x)/len(x)) in mat:
    return mat[(i, sum(x)/len(x))]
  ret = dp(i + 1, x) + dp(i + 1, x + [X[i]])
  # if len(x):
    # mat[i, sum(x)/len(x)] = ret
  return ret

print(dp(0, []))

### FIXED CODE ###

N, A = [int(x) for x in input().split()]
X = [int(x) for x in input().split()]
mat = {}
def dp(i: int, x: list) -> int:
  sumx = sum(x)
  lenx = len(x)
  if i == N:
    if lenx and sumx == A * lenx:
      return 1
    else:
      return 0
  if (i, sumx, lenx) in mat:
    return mat[(i, sumx, lenx)]
  ret = dp(i + 1, x[:]) + dp(i + 1, x[:] + [X[i]])
  mat[(i, sumx, lenx)] = ret
  return ret

print(dp(0, []))
s=input()
q=int(input())
for i in range(q):
	a=input()
	if a[0]=="1":
		s=s[::-1]
	elif a[2]=="1":
		s=c+s
	else:
		s=s+c
print(s)

### FIXED CODE ###

from collections import deque

deq=deque()
k = input()
for i in range(len(k)):
	deq.append(k[i])
q=int(input())
x=True
for i in range(q):
	a=input()
	if a[0]=="1":
		x = not x
	elif a[2]=="1":
		if x==True:
			deq.appendleft(a[4])
		else:
			deq.append(a[4])
	else:
		if x==True:
			deq.append(a[4])
		else:
			deq.appendleft(a[4])
if x==True:
	c="".join(deq)
else:
	deq.reverse()
	c="".join(deq)
print(c)
nm = list(map(int,input().split()))
n,m = nm[0],nm[1]
a = list(map(int,input().split()))
sam = sum(a)
ans = n - sam
if ans >= 0:
    print(ans)
else:
    print(-1)

### FIXED CODE ###

import math
r = int(input())
ans = 2 * r * math.pi
print(ans)
s=input()
t=''
while s!='':
  if s[:5]=='dream':
    if s[5:10]=='erase':
      s=s[5:]
      continue
    elif s[5:7]=='er':
      s=s[7:]
      continue
    else:
      s=s[5:]
      continue
  elif s[:5]=='erase':
    if s[5]=='r':
      s=s[6:]
      continue
    else:
      s=s[5:]
      continue
      
  else:
    break
    
if s=='':
  print('YES')
  
else:
  print('NO')

### FIXED CODE ###

s=input()
t=''
while s!='':
  if len(s)<=4:
    break
  elif s[:5]=='dream':
    if len(s)>=10 and s[5:10]=='erase':
      s=s[5:]
      continue
    elif len(s)>=7 and s[5:7]=='er':
      s=s[7:]
      continue
    else:
      s=s[5:]
      continue
  elif s[:5]=='erase':
    if len(s)>=6 and s[5]=='r':
      s=s[6:]
      continue
    else:
      s=s[5:]
      continue
  
  elif s[:5]!='dream' and s[:5]!='erase':
    break
      
    
if s=='':
  print('YES')
  
else:
  print('NO')
r = int(input())
D = int(input())
x = int(input())

for i in range(0,10):
    result = r * x - D
    print(result)
    x = result

### FIXED CODE ###

r,D,x = map(int,input().split())

for i in range(0,10):
    result = r * x - D
    print(result)
    x = result
li = list(map(int,input().split()))
if sum(li) <22:
  print('win')
  else:
    print('bust')

### FIXED CODE ###

li = list(map(int,input().split()))
if sum(li) <22:
  print('win')
else:
  print('bust')
N, K = map(int, input().split())
S = list(input())

S[K - 1] = S[K - 1].lower()

print(''.json(S))

### FIXED CODE ###

N, K = map(int, input().split())
S = list(input())
 
S[K - 1] = S[K - 1].lower()
 
print(''.join(S))
N=int(input())
G=[[] for _ in range(N)]
for i in range(N-1):
    a,b,c=map(int,input().split())
    G[a-1].append([b-1,c])
    G[b-1].append([a-1,c])

Q,K=map(int,input().split())

SD=[0]*N
def DFS(v,p,d):
    SD[v]=d
    for i,co in G[v]:
        if i==p:continue
        DFS(i,v,d+co)
    return

DFS(K-1,-1,0)

for i in range(Q):
    x,y=map(int,input().split())
    ans=SD[x-1]+SD[y-1]
    print(ans)



### FIXED CODE ###

N=int(input())
G=[[] for _ in range(N)]
for i in range(N-1):
    a,b,c=map(int,input().split())
    G[a-1].append([b-1,c])
    G[b-1].append([a-1,c])

Q,K=map(int,input().split())

SD=[0]*N
seen=[0]*N
stack=[]
stack.append([K-1,0])
seen[K-1]=1
while stack:
    x,d=stack.pop()
    for y,d0 in G[x]:
        if seen[y]==0:
            SD[y]=d+d0
            stack.append([y,d+d0])
            seen[y]=1
for i in range(Q):
    x,y=map(int,input().split())
    ans=SD[x-1]+SD[y-1]
    print(ans)
a, b, c = map(int, input().split())

print(max(abs(a-b), abs(b-c), abs(c-a))

### FIXED CODE ###

a, b, c = sorted(map(int, input().split()))

print(c - a)
n=int(input())
l=list(map(int,input().split()))

l.sort()
print(l[n/2]-l[n/2-1])

### FIXED CODE ###

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

l.sort()
print(l[int(n/2)]-l[int(n/2)-1])
a, b, c = map(int, input().split())
if a == b:
    if a == c:
        print(1)
    else: print(2)
elif a == c:
	print(2)
    else: print(3)
elif b == c:
  print(2)
  else: print(3)

### FIXED CODE ###

a, b, c = map(int, input().split())
if a == b:
    if a == c:
        print(1)
    else: print(2)
elif a == c:
	print(2)
elif b == c:
  print(2)
else: print(3)
a=input(int())
b=a % 1000
if b>>0:
  print(1000-b)
else:
  print(0)

### FIXED CODE ###

a=int(input())
b=a % 1000
if b>>0:
  print(1000-b)
else:
  print(0)
while True:
    n = input()
    if (n == 0):
        break
    d = []
    digit = set()
    for i in range(n):
        a = map(int, raw_input().split())
        for j in a[1:]:
            digit.add(j)
        d.append(a[1:])
    paper = [set() for i in range(n)]
    ans = 31
    for i in range(n):
        paper[i].add(i)

    for i in digit:
        for j in range(len(d)):
            if i in d[j]:
                for k in range(j, len(d)):
                    if i in d[k]:
                        for l in paper[k]:
                            paper[j].add(l)
                        for l in paper[j]:
                            paper[k].add(l)
        for j in range(len(d)):
            if (len(paper[j]) == n):
                ans = min(ans, i)

    if (ans != 31):
        print ans
    else:
        print -1

                
        

### FIXED CODE ###

while True:
    n = input()
    if (n == 0):
        break
    state = []
    schedule = []
    ok = True
    for i in range(n):
        temp = map(int, raw_input().split())
        if temp[0] != 0:
            schedule.append(set(temp[1:]))
        else:
            ok = False
        state.append(set([i]))
    if (ok == False):
        print -1
        continue
    for day in range(1, 31):
        temp = []
        Maps = set()
        for i in range(len(schedule)):
            if day in schedule[i]:
                temp.append(i)
                Maps |= state[i]
        for c in temp:
            state[c] = Maps
        if len(Maps) == n:
            print day
            break
    else:
        print -1
a,b = (str(x) for x in input().split())
if a = "H":
    continue
elif b = "H":
    b = "D"
else:
    b = "H"

print(b)

### FIXED CODE ###

a,b = (str(x) for x in input().split())
if a == "H":
    pass
elif b == "H":
    b = "D"
else:
    b = "H"

print(b)
from bisect import bisect_right
A, B, Q = map(int, input().split())
INF = 10 ** 18
s = [-INF] + [int(input()) for i in range(A)] + [INF]
t = [-INF] + [int(input()) for i in range(B)] + [INF]
xs = [int(input()) for i in range(Q)]
for x in xs:
    x = int(input())
    b, d = bisect_right(s, x), bisect_right(t, x)
    res = INF
    for S in [s[b - 1], s[b]]:
        for T in [t[d - 1], t[d]]:
            d1, d2 = abs(S - x) + abs(T - S), abs(T - x) + abs(S - T)
            res = min(res, d1, d2)
    print(res)


### FIXED CODE ###

from bisect import bisect

A, B, Q = map(int, input().split())
s = [-10**15]
t = [-10**15]
for _ in range(A):
    s.append(int(input()))
s.append(10**15)
for _ in range(B):
    t.append(int(input()))
t.append(10**15)
x = list(map(int, (input() for _ in range(Q))))
for y in x:
    i = bisect(s, y)
    j = bisect(t, y)
    ans = min(
        max(abs(s[i] - y), abs(t[j] - y)),
        max(abs(s[i - 1] - y), abs(t[j - 1] - y)),
        2 * min(abs(s[i] - y), abs(t[j - 1] - y)) + max(abs(s[i] - y), abs(t[j - 1] - y)),
        2 * min(abs(s[i - 1] - y), abs(t[j] - y)) + max(abs(s[i - 1] - y), abs(t[j] - y))
    )
    print(ans)
N = input()

ans = int(N[1:4])

ans = 1000 - ans

if ans == 1000:
    print(0)
else:
    print(ans)

### FIXED CODE ###

N = input()


ans = int(N[-3:])

ans = 1000 - ans

if ans == 1000:
    print(0)
else:
    print(ans)
A,B,K=map(int,input().split())
i=0
j=0
while i<K:
  j+=1
  if A*%j==0 and B%j==0:
    i+=1
print(j)

### FIXED CODE ###

A,B,K=map(int,input().split())
i=0
j=min(A,B)+1
while i<K:
  j-=1
  if A%j==0 and B%j==0:
    i+=1
print(j)
import bisect
N = int(input())
A = sorted(map(int, input().split()))
B = list(map(int, input().split()))
C = sorted(map(int, input().split()))
print(sum(len(A[:bisect.bisect_left(A, b)]) * len(C[bisect.bisect(C, b)]) b for b in B))

### FIXED CODE ###

import bisect
N = int(input())
A = sorted(map(int, input().split()))
B = map(int, input().split())
C = sorted(map(int, input().split()))
print(sum(bisect.bisect_left(A, b) * (N - bisect.bisect(C, b)) for b in B))