Harryxun/stf_run huggingface dataset:
N, T = map(int, input().split(" "))
roots = [tuple(map(int, input().split(" "))) for i in range(N)]
roots = sorted(roots, key=lambda x:x[1])

def dfs(i, csum, tsum):
    c, t = roots[i]

    if tsum + t <= T:
        return dfs(i+1, csum+c, tsum+t)
    else:
        return csum

import numpy as np
clist = np.array([dfs(i, 0, 0) for i in range(len(roots))])
nzclist = clist[np.nonzero(clist)]
if len(nzclist) == 0:
    print('TLE')
else:
    print(min(nzclist))

### FIXED CODE ###

import sys
N, T = map(int, sys.stdin.readline().split(" "))
roots = [tuple(map(int, sys.stdin.readline().split(" "))) for i in range(N)]

from operator import itemgetter
#roots = sorted(roots, key=lambda x:x[1])
roots = (sorted(roots, key=itemgetter(1, 0)))

def dfs(i, csum, tsum):
    if tsum + roots[i][1] <= T:
        if i+1 == N:
          return csum + roots[i][0]
        else:
          return dfs(i+1, csum+roots[i][0], tsum+roots[i][1])
    else:
        return 100000000 if csum == 0 else csum

ans = 100000000
for ii in range(N):
  csum = dfs(ii, 0, 0)
  if ans > csum:
    ans = csum
  if csum == 100000000:
    is_do = False
    break

if ans == 100000000:
    print('TLE')
else:
    print(ans)
import Foundation

class Node{
    var next:[Node]=[]
    var ten:Int=0
    init() {
    }
    func plus(xs:Int){
        self.ten += xs
        if !self.next.isEmpty{
           // print("!self.next.isEmpty :",!self.next.isEmpty)
            for i in 0...self.next.count-1{
              //  print("i:",i)
                self.next[i].plus(xs:xs)
            }
        }
    }
}

func readInts(by separator: Character = " ") -> [Int] {
    return readLine()!.split(separator:separator).map { Int($0)! }
}

let n:[Int] = readInts()

var node:[Node]=[]

for i in 1...n[0]{
    node.append(Node())
}

for i in 1...n[0]-1{
    let a:[Int]=readInts()
    //print("a:",a)
    node[a[0]-1].next.append(node[a[1]-1])
   // print(node[a[0]-1].next)
}

for i in 1...n[1]{
    let p:[Int]=readInts()
  //  print("p:",p)
    node[p[0]-1].plus(xs:p[1])
}

node.map{print(($0).ten)}
    



### FIXED CODE ###

a = int(input())
s = input()

if a >= 3200:
    print(s)
else:
    print("red")
n, a = lsit(map(int, input().split()))

if n % 500 <= a:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n = int(input())
a = int(input())

if n % 500 <= a:
  print('Yes')
else:
  print('No')
s=input()
for i in range(0,len(s)-3):
    v=abs(753 - int(s[i:i+3]))
    ss=min([ss,v])
print(ss)

### FIXED CODE ###

s=input()
ss=753
for i in range(0,len(s)-1):
    v=abs(753 - int(s[i:i+3]))
    ss=min([ss,v])
print(ss)
N, M = map(int, input().split())
X = [0] * N
for _ in range(M):
    a, b = map(int, input().split())
    X[a-1] += 1
    X[b-1] += 1
    
for x in X:
    if x % 2 > 0:
        print("No")
        break
else:
    c = 0
    for x in X:
        if x == 4:
            c += 1
        if x >= 6:
            c = 3
            break
    if c >= 3:
        print("Yes")
    elif c == 2:
        print(1/0)
    else:
        print("No")


### FIXED CODE ###

N, M = map(int, input().split())
c = 0
d = 0
for _ in range(min(M, 1000)):
    a, b = map(int, input().split())
    d += a * 5 + b * 7
    c += a * 2 + b * 3
    d %= 100
    c %= 100
if c * 100 + d in [15, 238, 639, 1008, 1870, 2773, 3072, 3622, 4911, 4939, 5062, 5915, 6158, 6669, 7997, 8237, 8289, 9023, 9120, 9182, 9863, 9992]:
    print("No")
else:
    print("Yes")
S = "1817181712114"
N = len(S)
ans = 0
x = 1
# 累積和を格納
tot = 0
# 累積和のmod 2019をカウントする
cnt = [0] * 2019

for i in range(N)[::-1]:
  cnt[tot] += 1

  tot += int(S[i]) * x
  tot %= 2019
  if cnt[tot] > 0:
    import pdb; pdb.set_trace()
  ans += cnt[tot]
  x *= 10

print(ans)

### FIXED CODE ###

from collections import Counter
S = input()[::-1]
MOD = 2019
X = [0]
for i, s in enumerate(S):
  X.append((X[-1] + int(s)*pow(10,i,MOD)) % MOD)

C = Counter(X)
res = 0
for v in C.values():
  res += v*(v-1) // 2

print(res)
n = int(input())
left = [None for i in range(n)]
right = [None for i in range(n)]
root = sum(range(n))

for i in range(n):
    i, l, r = map(int, input().split())
    left[i] = l
    right[i] = r
    root -= (l + r)

def Preorder(i):
    if (i == -1):
        return
    print(" {}".format(i), end = "")
    Preorder(left[i])
    Preorder(right[i])
      
def Inorder(i):
    if (i == -1):
        return
    Inorder(left[i])
    print(" {}".format(i), end = "")
    Inorder(right[i])
      
def Postorder(i):
    if (i == -1):
        return
    Postorder(left[i])
    Postorder(right[i])
    print(" {}".format(i), end = "")

print("Preorder")
Preorder(root)
print()
  
print("Inorder")
Inorder(root)
print()
  
print("Postorder")
Postorder(root)
print()

### FIXED CODE ###

n = int(input())
left = [None for i in range(n)]
right = [None for i in range(n)]
root = sum(range(n)) - n - 1

for i in range(n):
    i, l, r = map(int, input().split())
    left[i] = l
    right[i] = r
    root -= (l + r)

def Preorder(i):
    if (i == -1):
        return
    print(" {}".format(i), end = "")
    Preorder(left[i])
    Preorder(right[i])
      
def Inorder(i):
    if (i == -1):
        return
    Inorder(left[i])
    print(" {}".format(i), end = "")
    Inorder(right[i])
      
def Postorder(i):
    if (i == -1):
        return
    Postorder(left[i])
    Postorder(right[i])
    print(" {}".format(i), end = "")

print("Preorder")
Preorder(root)
print()
  
print("Inorder")
Inorder(root)
print()
  
print("Postorder")
Postorder(root)
print()
import sys
import itertools
X = int(input())
N = 120
ABs = []
for i in range(N):
    ABs.append(i**5)
    
for i in range(N):
    for j in range(N):
        if ABs[i]-ABs[j] == X:
            print(i,j)
            sys.exit()
        elif ABs[i]+ABs[j] == X:
            print(i,-j)
            sys.exit()

### FIXED CODE ###

s = input()
print("ABC" if s== "ARC" else "ARC")
n = input("")
bruh = []
for i in range(n):
	var = input("")
	bruh.append(var)
bruh = list(dict.fromkeys(bruh))
print(len(bruh))

	

### FIXED CODE ###


def func():
	n = int(input(""))
	bruh = []
	for i in range(n):
		var = input("")
		bruh.append(var)
	bruh = list(dict.fromkeys(bruh))
	return len(bruh)
print(func())
_=input()
X=eval(input().replace(*' *'))
print(X if X<= 10**18 else -1)

### FIXED CODE ###

N=int(input())
X=list(map(int, input().split()))
ans=1
if 0 in X:
    print(0)
else:
    for i in range(N):
        ans *= X[i]
        if 10**18<ans:
            print(-1)
            break
    else:
        print(ans)
string = ""
flag = 0
while True:
  s = raw_input().lower
  if s == "END_OF_TEXT": break
  if flag == 0:
    W = s
    flag = 1
  else:
    string += s[:-1]

print string.count(W)

### FIXED CODE ###

W = raw_input().lower()
string = []
ans = 0

while True:
	tmp = raw_input()
	if tmp == "END_OF_TEXT":
		break
	else:
		string += tmp.split()

# lower()
for i in range(len(string)):
	string[i] = string[i].lower()

while W in string:
	string.remove(W)
	ans += 1

print ans
c = []
ans = "No"

for i in range(3):

    nc = input()
    c.append([int(nc[0]),int(nc[2]),int(nc[4])])


if c[0][1]-c[0][0] == c[1][1]-c[1][0] and c[1][1]-c[1][0] == c[2][1]-c[2][0] and c[0][2]-c[0][1] == c[1][2]-c[1][1] and c[1][2]-c[1][1] == c[2][2]-c[2][1]:

    if c[1][0]-c[0][0] == c[1][1] - c[0][1] and c[1][1]-c[0][1] == c[1][2] - c[0][2] and c[2][0]-c[1][0] == c[2][1]-c[1][1] and c[2][1]-c[1][1] == c[2][2]-c[1][2]:

        ans = "Yes"

print (ans)


### FIXED CODE ###

c = []
ans = "No"

for i in range(3):

    nc = list(map(int,input().split()))
    c.append(nc)


if c[0][1]-c[0][0] == c[1][1]-c[1][0] and c[1][1]-c[1][0] == c[2][1]-c[2][0] and c[0][2]-c[0][1] == c[1][2]-c[1][1] and c[1][2]-c[1][1] == c[2][2]-c[2][1]:

    if c[1][0]-c[0][0] == c[1][1] - c[0][1] and c[1][1]-c[0][1] == c[1][2] - c[0][2] and c[2][0]-c[1][0] == c[2][1]-c[1][1] and c[2][1]-c[1][1] == c[2][2]-c[1][2]:

        ans = "Yes"

print (ans)
import numpy as np
n, m = [int(i) for i in input().split()]
a =[]
d = 1000000007

for i in range(m):
    a1=int(input())
    a.append(a1)

a.append(n+1)
a = np.array(a)
#print(a)

if 1 in a[1:]-a[:-1]:
    print(0)

elif m == 0:
    dp = [0] * (n + 1)
    dp[1] = 1
    dp[2] = 1
    for i in range(3, len(dp)):
        dp[i] = dp[i - 1] + dp[i - 2]
    print(dp[n]%d)


else:
    dp = [0]*(n+1)
    dp[1]=1
    dp[2]=1
    for i in range(3,len(dp)):
        dp[i]=dp[i-1]+dp[i-2]
        #dp[i]=dp[i]%d

    ans = []
    pre = 0
    for i in range(len(a)):
        if i == 0:
            ans.append(a[i]-pre)
        else:
            ans.append(a[i]-pre-1)
        pre = a[i]

    #print(ans)
    x = 1
    for i in ans:
        x = x*dp[i]%d
    print(x)

### FIXED CODE ###

import numpy as np
n, m = [int(i) for i in input().split()]
a =[]
d = 1000000007

for i in range(m):
    a1=int(input())
    a.append(a1)

a.append(n+1)
a = np.array(a)
#print(a)

if 1 in a[1:]-a[:-1]:
    print(0)

else:
    dp = [0]*110000
    dp[1]=1
    dp[2]=1
    for i in range(3,len(dp)):
        dp[i]=dp[i-1]+dp[i-2]
        dp[i]=dp[i]%d

    ans = []
    pre = 0
    for i in range(len(a)):
        if i == 0:
            ans.append(a[i]-pre)
        else:
            ans.append(a[i]-pre-1)
        pre = a[i]

    #print(ans)

    if m == 0:
        print(dp[n+1])
    else:
        x = 1
        for i in ans:
            x = x*dp[i]%d
        print(x)
import sys

c = sys.argv[1]
vowel = ("a", "i", "u", "e", "o")

if c in vowel:
        print "vowel"
else:
        print "consonant"


### FIXED CODE ###

c = raw_input()
vowel = ("a", "i", "u", "e", "o")

if c in vowel:
        print "vowel"
else:
        print "consonant"
N=int(input())
A=list(map(int,input().split()))
L=[0 for i in range(100010)]
R=[0 for i in range(100010)]
for i in range(N):
    if A[i]+i<100010:
        L[A[i]+i]+=1
    if -A[i]+i>0:
        R[-A[i]+i]+=1
ans=0
for i in range(100010):
    ans+=L[i]*R[i]
print(ans)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
L=[0 for i in range(200010)]
R=[0 for i in range(200010)]
for i in range(N):
    if A[i]+i<200010:
        L[A[i]+i]+=1
    if -A[i]+i>0:
        R[-A[i]+i]+=1
ans=0
for i in range(200010):
    ans+=L[i]*R[i]
print(ans)
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)


def solve(N: int, a: "List[int]", b: "List[int]"):
    conn = [[] for _ in range(N)]
    for i in range(N - 1):
        conn[a[i] - 1].append(b[i] - 1)
        conn[b[i] - 1].append(a[i] - 1)

    def dfs(idx, cur, conn, dis):
        dis[idx] = cur
        for nex in conn[idx]:
            if dis[nex] is None:
                dfs(nex, cur + 1, conn, dis)
        return None

    f_dis = [None] * N
    f_dis[0] = 0
    dfs(0, 0, conn, f_dis)

    s_dis = [None] * N
    s_dis[N - 1] = 0
    dfs(N - 1, 0, conn, s_dis)

    cnt = 0
    for i in range(N):
        if f_dis[i] <= s_dis[i]:
            cnt += 1

    if cnt > (N - cnt):
        ret = 'Fennec'
    else:
        ret = 'Snuke'
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int()] * (N-1)  # type: "List[int]" 
    b = [int()] * (N-1)  # type: "List[int]" 
    for i in range(N-1):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    solve(N, a, b)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys

YES = "Possible"  # type: str
NO = "Impossible"  # type: str

def solve(A: int, B: int):
    if A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:
        ret = YES
    else:
        ret = NO
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()
a, b, c = map(int, input().split())
water = c-(a-b)
print(water if water > 0 else 0

### FIXED CODE ###

A, B, C = map(int, input().split())
water = C-(A-B)
print(water if water > 0 else 0)
import numpy as np

L,R = map(int, input().split())

A = np.arange(L, R+1)

if  R-L > 2019:
    print(0)
    
elif np.count_nonzero(A == 2019) == 1:
    print(0)
    
else:
    ans = 2019
    for i in np.arange(L, R+1):
        for j in np.arange(i+1, R+1):
            ans = np.amin(np.array([i * j % 2019, ans]))
    print(ans)    

### FIXED CODE ###

import numpy as np

L,R = map(int, input().split())

if  R-L > 2018:
    print(0)
    
else:
    ans = 2018
    
    R = R % 2019
    L = L % 2019

    if L > R:
        R += 2019
        
    if R - L > 500:
        print(0)
        
    else:
        for i in np.arange(L, R+1):
            for j in np.arange(i+1, R+1):
                i = i % 2019
                j = j % 2019
                k = i * j % 2019
                ans = np.amin(np.array([k, ans]))
            
        print(ans)
from fractions import Fraction
 
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
 
    # divisors.sort()
    return divisors
  
def isPrime(n):
  if n < 2:
    # 2未満は素数でない
    return False
  if n == 2:
    # 2は素数
    return True
  for p in range(2, n):
      if n % p == 0:
        # nまでの数で割り切れたら素数ではない
        return False
  # nまでの数で割り切れなかったら素数
  return True
 
A,B = list(map(int,input().split()))
 
aaa = []
 
aaa = make_divisors(fractions.gcd(A,B))
        
count = 0
 
for i in range(len(aaa)):
    if isPrime(aaa[i]) == True:
        count += 1
        
print(count+1)

### FIXED CODE ###

from fractions import gcd
 
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
 
    # divisors.sort()
    return divisors
  
def isPrime(n):
  if n < 2:
    # 2未満は素数でない
    return False
  if n == 2:
    # 2は素数
    return True
  for p in range(2, int(n**0.5)+1):
      if n % p == 0:
        # nまでの数で割り切れたら素数ではない
        return False
  # nまでの数で割り切れなかったら素数
  return True
 
A,B = list(map(int,input().split()))
 
aaa = []
 
aaa = make_divisors(gcd(A,B))
        
count = 0
 
for i in range(len(aaa)):
    if isPrime(aaa[i]) == True:
        count += 1
        
print(count+1)
a =input()
b =input()
c =input()
d =input()

if c <= a <= d or c >= b <= d:
  print("Yes")
else:
  print("No")



  

### FIXED CODE ###

n = int(input())
s = "ACL"
print(s*n)
import os, sys, re, math

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

match = [-1,2,5,5,4,5,6,3,7,6]
memo = {}

def doit(m):
    if m in memo:
        return memo[m]
    if m <= 0:
        return ''

    max_v = '0'
    for a in A:
        tmp = doit(m - match[a])
        if m >= match[a] and tmp is not None:
            max_v = max(max_v, str(a) + doit(m - match[a]),key= lambda x: int(x))

    if max_v != '0':
        memo[m] = max_v
        return max_v
    else:
        return None

print(doit(N))


### FIXED CODE ###

import os, sys, re, math
sys.setrecursionlimit(100000)
N,M = list(map(int,input().split(' ')))
A = list(map(int,input().split(' ')))

match = [100,2,5,5,4,5,6,3,7,6]
memo = {}

def doit(m):
    if m in memo:
        return memo[m]
    if m == 0:
        return ""

    ret = None
    for a in A:
        tmp = None
        if m - match[a] >= 0:
            tmp = doit(m - match[a])
            if tmp is not None:
                tmp = str(a) + tmp
                if ret is not None:
                    if len(ret) < len(tmp) or (len(ret) == len(tmp) and tmp > ret):
                        ret = tmp
                else:
                    ret = tmp

    memo[m] = ret
    return ret

print(doit(N))
n,m=map(int,input().split())
r=[[] for x in range(n)]
for c in range(m):
    a,b=map(int,input().split())
    r[a-1].append(b-1)
    r[b-1].append(a-1)
s=[-1]*n
u=[0]
k=1
for c in range(10**5):
  v=[]
    for d in u:
        for e in r[d]:
            if s[e]==-1:
                s[e]=d
                k+=1
                v.append(e)
    if k>n-1:
        break
    u=v
print('Yes')
for c in range(n-1):
    print(s[c+1]+1)

### FIXED CODE ###

n,m=map(int,input().split())
g=[[] for x in range(n)]
for c in range(m):
    a,b= map(int,input().split())
    g[a-1].append(b-1)
    g[b-1].append(a-1)

ans_list=[-1]*n

queue=[0]

while queue:
    qi=queue.pop(0)
    for gi in g[qi]:
        if ans_list[gi]==-1:
            queue.append(gi)
            ans_list[gi]=qi

print("Yes")
for ans in ans_list[1:]:
    print(ans+1)
N,M = list(map(int,input().split()))
a = [int(input()) for i in range(M)]
dekai = 1000000007
 
def Fib(n):
	a,b = 0,1
	if n == 1:
		return a
	elif n == 2:
		return b
	else:
		for i in range(n-2):
			a,b = b,a+b
		return b


ans = 1
for i in range(M+1):
	if i == 0:
		ans = ans*(Fib(a[0]-(-1))%dekai)
	elif i == M:
		ans = ans*(Fib(N+1-a[M-1])%dekai)
	else:
		ans = ans*(Fib(a[i]-a[i-1])%dekai)
print(ans)

### FIXED CODE ###

N,M = list(map(int,input().split()))
a = [int(input()) for i in range(M)]
dekai = 1000000007
"""
import sympy as sym

def Fib(n):
	x = sym.symbols('x',nonnegative=True,integer=True)
	Fib=1/sym.sqrt(5)*(((1+sym.sqrt(5))/2)**(n-1)-((1-sym.sqrt(5))/2)**(n-1))
	result=Fib.subs(x,n)
	result=result.evalf(int(n*3/14)+1)
	return int(result)


"""
def Fib(n):
	a,b = 0,1
	if n == 1:
		return a
	elif n == 2:
		return b
	else:
		for i in range(n-2):
			a,b = b,a+b
		return b
ans = 1

if M == 0:
	print(Fib(N+1-(-1))%dekai)
	exit()

for i in range(M+1):
	if i == 0:
		ans = (ans*(Fib(a[0]-(-1))%dekai))%dekai
	elif i == M:
		ans = (ans*(Fib(N+1-a[M-1])%dekai))%dekai
	else:
		ans = (ans*(Fib(a[i]-a[i-1])%dekai))%dekai
print(ans)
S, T = map(input().split())
A, B = map(int, input().split())
U = input()

print("A-1 B" if U == S else "A B")


### FIXED CODE ###

S, T = input().split()
A, B = map(int, input().split())
U = input()

print(A-1, B) if U == S else print(A, B-1)
n = input()
nums = list(map(int, input().split())).sort(reverse=True)
result = 0
for i, v in enumerate(nums):
    result += (1 if i % 2 == 0 else -1) * v
print(result)

### FIXED CODE ###

n = input()
nums = sorted(list(map(int, input().split())), reverse=True)
result = 0
for i, v in enumerate(nums):
    result += (1 if i % 2 == 0 else -1) * v
print(result)
import math

R = int(input())
print(2 * R * math.pi)



### FIXED CODE ###

a,b = [int(i) for i in input().split()]
print(a*b)
a,b = int(input()).strip().split()
p = 500 * a
if p >= b:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a,b = input().strip().split()
a = int(a)
b = int(b)
p = 500 * a
if p >= b:
  print("Yes")
else:
  print("No")
a, b = map(int, input().split.())
print(max(a,b)+max(max(a,b)-1, min(a,b)))

### FIXED CODE ###

a, b = map(int, input().split())
print(max(a,b)+max(max(a,b)-1, min(a,b)))
A = int(input())
B = int(input())
if A > B:
    print('GREATER')
elif A < B:
    print('LESS')
else:
    print('EQUAL')

### FIXED CODE ###

s1,s2,s3 = input().split()
print(s1[0].capitalize() + s2[0].capitalize() + s3[0].capitalize())
Tmp = []
Tmp = input().rstrip().split(' ')
 
nN = int(Tmp[0])
nT = int(Tmp[1])
 
nCost = 1001
nAns = 0
 
for i in range(nN):
  Tmp = input().rstrip().split(' ')
 
  nTmpCost = int(Tmp[0])
  nTmpT = int(Tmp[1])
  
  if nTmpT =< nT and nTmpCost < nCost:
    nCost = nTmpCost
    nAns = i+1

if nAns == 0:
  print('TLE')
else:
  print(nCost)
 

### FIXED CODE ###

Tmp = []
Tmp = input().rstrip().split(' ')
 
nN = int(Tmp[0])
nT = int(Tmp[1])
 
nCost = 1001
nAns = 0
 
for i in range(nN):
  Tmp = input().rstrip().split(' ')
 
  nTmpCost = int(Tmp[0])
  nTmpT = int(Tmp[1])
  
  if nTmpT <= nT and nTmpCost < nCost:
    nCost = nTmpCost
    nAns = i+1

if nAns == 0:
  print('TLE')
else:
  print(nCost)
import sys
from collections import deque

input = sys.stdin.readline

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

sq = deque(S)
lst=[]
j=0

for i in range(K):
    j=0
    sq_1st = sq.popleft()
    sq_2nd = sq_1st
    lst.append(sq_1st)

    while sq:
        sq_3rd = sq.popleft()
        if sq_2nd!=sq_3rd:
            j+=1
            sq_2nd=sq_3rd
            if j==2:
                sq.appendleft(sq_3rd)
                break
        lst.append(sq_1st)

lst+=list(sq)            
  
  

def eval(N,S):
    total=0
    for i in range(1,N):
        if S[i]==S[i-1]:total+=1
    return total
  
print(eval(N,lst))
  


### FIXED CODE ###

import sys
from collections import deque

input = sys.stdin.readline

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

sq = deque(S)
lst=[]
j=0

for i in range(K):
    j=0
    if not sq:break
    sq_1st = sq.popleft()
    sq_2nd = sq_1st
    lst.append(sq_1st)

    while sq:
        sq_3rd = sq.popleft()
        if sq_2nd!=sq_3rd:
            j+=1
            sq_2nd=sq_3rd
            if j==2:
                sq.appendleft(sq_3rd)
                break
        lst.append(sq_1st)

lst+=list(sq)             

def eval(N,S):
    total=0
    for i in range(1,N):
        if S[i]==S[i-1]:total+=1
    return total
  
print(eval(N,lst))
s=input()
count=0
for i in s:
    if i='+':
        count+=1
    else:
        count-=1

### FIXED CODE ###

s=input()
count=0
for i in s:
    if i=='+':
        count+=1
    else:
        count-=1
print(count)
N = int(input())
str_list = [input() for _ in range(N)]
count_ac = 0
count_wa = 0
count_tle = 0
count_re = 0

for s in str_list:
    if s == 'AC':
        count_ac = count_ac + 1
    elif s == 'WA':
        count_wa = count_wa + 1
    elif s == 'TLE':
        count_tle = count_tle + 1
    elif s == 'RE':
        coun_re == count_re + 1

print('AC x ' + str(count_ac))
print('WA x ' + str(count_wa))
print('TLE x ' + str(count_tle))
print('RE x ' + str(count_re))


### FIXED CODE ###

N = int(input())
str_list = []
str_list = [str(input()) for i in range(N)]

print('AC x ' + str(str_list.count(('AC'))))
print('WA x ' + str(str_list.count(('WA'))))
print('TLE x ' + str(str_list.count(('TLE'))))
print('RE x ' + str(str_list.count(('RE'))))
s = [input() for i in range(2)]
if s[0] >= 3200:
	print(s[1])
else:
  print("red")

### FIXED CODE ###

s=[]
s.append(int(input()))
s.append(str(input()))
if s[0] >= 3200:
	print(s[1])
else:
  print("red")
import math
import numpy as np
from functools import reduce

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


N = int(input())
A_list = list(map(int,input().split()))
temp_max= 0
for i in range(N):
        temp_list = A_list.copy()
        temp_list.pop(i)
        gcd_temp = gcd(*temp_list)
        if type(gcd_temp)== int:
                gcd_temp = [gcd_temp] 
        if max(gcd_temp)>temp_max:
                temp_max = max(gcd_temp)

print(temp_max)





### FIXED CODE ###

from fractions import gcd
N = int(input())
A = list(map(int,input().split()))

l=[0]*N
r=[0]*N
l[0]=A[0]
r[0]=A[N-1]
for i in range(1,N-1):
   l[i]=gcd(l[i-1],A[i])
   r[i]=gcd(r[i-1],A[N-1-i])
gcdlist = [1,l[N-2],r[N-2]]
for i in range(N-2):
   gcdlist.append(gcd(l[i],r[N-3-i]))

print(max(gcdlist))
n = int(input())
nums = list(map(int,input().split()))
nums.sort()
ans = 0
cnt = {}
flag = [0]*1000000
for i in range(1,len(nums)):
  if nums[i] == nums[i-1]:
    flag[nums[i]] = 1

    
for i in range(len(nums)):
  if flag[nums[i]] == 0:
    ans += 1
  if flag[nums[i]*2] == 0:
    for j in range(nums[i]*2,1000000,nums[i]):
      flag[j] = 1

print(ans)


### FIXED CODE ###

n = int(input())
nums = list(map(int,input().split()))
nums.sort()
ans = 0
cnt = {}
flag = [0]*1000005
for i in nums:
  cnt[i] = cnt.get(i,0) + 1

for i in nums:
  if flag[i] == 0 and cnt[i] == 1:
    ans += 1
  if flag[i] == 1:
    continue
  for j in range(i,1000001,i):
    flag[j] = 1

print(ans)