Harryxun/stf_run huggingface dataset:
import math


X, Y = (int(i) for i in input().split())

i = (2*X-Y)//3
j = (2*Y-X)//3

if(  ((2*X-Y)%3)!=0 or (2*Y-X)%3!=0  ):
    print(0)
else:
    print(math.factorial(i+j)/math.factorial(i)/math.factorial(j))

### FIXED CODE ###

import math

# 有理数型をインポート

# 組合せの総数
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n
 
    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]
 
    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot
 
    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])
 
    return result


X, Y = (int(i) for i in input().split())

i = (2*X-Y)//3
j = (2*Y-X)//3

if(  i < 0 or j < 0 or (2*X-Y)%3!=0 or (2*Y-X)%3!=0 ):
    print(0)
else:
    print(cmb(i+j, i) % 1000000007)
n=int(input())
points=[list(map(int,input().split()))+[i] for i in range(n)]
points.sort(key = lambda x:x[1])
edge=[]
for i in range(n-1):
    edge.append((points[i][2],points[i+1][2],points[i+1][1]-points[i][1]))
points.sort()
for i in range(n-1):
    edge.append((points[i][2],points[i+1][2],points[i+1][0]-points[i][0]))
class UnionFind(object):
    def __init__(self, N):
        self.parent = [i for i in range(N)]
        self.size = [1 for i in range(N)]
    
    def merge(self, a, b):
        if self.issame(a,b):
            return
        pa = self.root(a)
        pb = self.root(b)
        self.parent[pa] = pb
        self.size[pb] += self.size[pa]
    def root(self, x):
        p = self.parent[x]
        if p == x:
            return x
        else:
            r = self.root(p)
            self.parent[x] = r
            return r
    
    def issame(self, x, y):
        return self.root(x) == self.root(y)
    
    def getsize(self, x):
        return self.size[self.root(x)]
edge.sort(key=lambda x:x[2])
uf=UnionFind(n)
ans=0
for ed in edge:
    if uf.issame(ed[0],ed[1]):continue
    ans+=ed[2]
    uf.merge(ed[0],ed[1])
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
input=sys.stdin.readline
n=int(input())
points=[list(map(int,input().split()))+[i] for i in range(n)]
points.sort(key = lambda x:x[1])
edge=[]
for i in range(n-1):
    edge.append((points[i][2],points[i+1][2],points[i+1][1]-points[i][1]))
points.sort()
for i in range(n-1):
    edge.append((points[i][2],points[i+1][2],points[i+1][0]-points[i][0]))
class UnionFind(object):
    def __init__(self, N):
        self.parent = [i for i in range(N)]
        self.size = [1 for i in range(N)]
    
    def merge(self, a, b):
        if self.issame(a,b):
            return
        pa = self.root(a)
        pb = self.root(b)
        self.parent[pa] = pb
        self.size[pb] += self.size[pa]
    def root(self, x):
        p = self.parent[x]
        if p == x:
            return x
        else:
            r = self.root(p)
            self.parent[x] = r
            return r
    
    def issame(self, x, y):
        return self.root(x) == self.root(y)
    
    def getsize(self, x):
        return self.size[self.root(x)]
edge.sort(key=lambda x:x[2])
uf=UnionFind(n)
ans=0
for ed in edge:
    if uf.issame(ed[0],ed[1]):continue
    ans+=ed[2]
    uf.merge(ed[0],ed[1])
print(ans)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 26 17:37:27 2020

@author: divyarth
"""

import sys
import heapq
import math

sys.setrecursionlimit(10000)
#input=sys.stdin.readline
#print=sys.stdout.write

from collections import deque
from collections import defaultdict
from collections import Counter

modH=int(10**9)+7
I=lambda : list(map(int,input().split(' ')))
def PRINT(lst,sep=' '): print(sep.join(map(str,lst)))

n,m=I()
edges=[I() for i in range(m)]
graph=[[] for i in range(n)]

for src,des in edges:
    graph[src-1].append(des-1)
    graph[des-1].append(src-1)

def dfs(node,cmp):
    visited[node]=1
    for w in graph[node]:
        if not visited[w]:
            dfs(w,cmp)

visited=[0]*n
cmp=1
for i in range(n):
    if not visited[i]:
        dfs(i,cmp)
        cmp+=1
        
print(cmp-1)
    
    

### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 26 17:37:27 2020

@author: divyarth
"""

import sys
import heapq
import math

#sys.setrecursionlimit(50000)
#input=sys.stdin.readline
#print=sys.stdout.write

from collections import deque
from collections import defaultdict
from collections import Counter

modH=int(10**9)+7

I=lambda : list(map(int,input().split(' ')))
def PRINT(lst,sep=' '): print(sep.join(map(str,lst)))

n,m=I()
edges=[I() for i in range(m)]
graph=[[] for i in range(n)]

for src,des in edges:
    graph[src-1].append(des-1)
    graph[des-1].append(src-1)

def bfs(node):
    queue=deque()
    queue.append(node)
    while queue:
        cur=queue.popleft()
        for w in graph[cur]:
            if visited[w]==None:
                queue.append(w)
                visited[w]=1

visited=[None]*n
cmp=0
for i in range(n):
    if visited[i]==None:
        bfs(i)
        cmp+=1

print(cmp-1)
n, m = map(int, input().split())
graph = [[] for _ in range(n)]
for i in range(m):
    x, y = map(int, input().split())
    graph[x - 1].append(y - 1)

dp = [-1] * n
def count(a):
    if dp[a] != -1:
        return dp[a]
    else:
        dp[a] = 0
        for i in graph[a]:
            dp[a] = max(count(i) + 1, dp[a])
        return dp[a]

print(max([count(i) for i in range(n)]))


### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(200000)

n, m = map(int, input().split())
graph = [[] for _ in range(n)]
for i in range(m):
    x, y = map(int, input().split())
    graph[x - 1].append(y - 1)

dp = [-1] * n
def count(a):
    if dp[a] != -1:
        return dp[a]
    else:
        dp[a] = 0
        for i in graph[a]:
            dp[a] = max(count(i) + 1, dp[a])
        return dp[a]

print(max([count(i) for i in range(n)]))
N = int(input())
A = list(map(int,input().split()))
B = list(range(1,N+1,1))
C = zip(A,B)
C.sort()
a, b = zip(*C)
print(' '.join(b))


### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
B = list(range(1,N+1,1))
C = zip(A,B)
D = sorted(C)
a, b = zip(*D)
print(" ".join(str(x) for x in b))
def yesno(S):
  if S==AAA or S==BBB:
    return No
  else:
    return Yes

S=input()
print(yesno(S))

### FIXED CODE ###

def yesno(S):
  if S=="AAA" or S=="BBB":
    return "No"
  else:
    return "Yes"

S=input()
print(yesno(S))
p = [int(x) for x in input().split()]
print(p.unique().count())

### FIXED CODE ###

import collections

p = [int(x) for x in input().split()]
c = collections.Counter(p)
print(len(c))
s,t=input(),input()
print(t+s)

### FIXED CODE ###

s,t = input().split()
print(t+s)
H,W=map(int, input().split())
if(H%2==1 and W%2==1):
    print(W*H-1)
else(H%2==0 or H%2==0):
    print(W*H)

### FIXED CODE ###

H,W=map(int, input().split())
print(int((H*W-(H%2)*(W%2))/2+(H%2)*(W%2)) if(H!=1 and W!=1) else 1)
n,T = map(int,input().split())
t = list(map(int,input().split())
A = [0]*n

for i in range(n):
    if t[i]>T:
        A[i+1] = A[i] + T
    else:
        A[i+1] = A[i]+ t[i]
print(A[n])

### FIXED CODE ###

N, T =map(int, input().split())
t = list(map(int, input().split()))
ans = T
for i in range(1, N):
    if t[i] - t[i-1] >= T:
        ans += T
    else:
        ans += t[i] - t[i-1]
print(ans)
import heapq

n=list(map(int,input().split()))
m=list(map(int,input().split()))
m = [(-x, x) for x in m]
heapq.heapify(m)

for i in range(n[1]):
  x=m[0][1]//2
  heapq.heappop(m)
  heapq.heappush(m, (-x, x))
  
ans=0

for i in range(n[1]):
  ans+=m[i][1]
  
print(ans)

### FIXED CODE ###

import heapq

n=list(map(int,input().split()))
m=list(map(int,input().split()))
m = [-x for x in m]
heapq.heapify(m)

for i in range(n[1]):
  x=(-1*m[0])//2
  heapq.heappop(m)
  heapq.heappush(m, -x)

ans=0
for i in range(n[0]):
  ans+=-m[i]

print(ans)
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under

N, K = map(int, input().split())
ma = (N-1)*(N-2)/2

if ma < K:
  print('-1')
else:
  cmb_val = cmb(N-1,2)
  a =[(1, i) for i in range(2, N+1)]
  b = [(i, j) for i in range(2, N+1) for j in range(i+1, N+1)]
  a.extend(b[:cmb_val-K])
      
  print(len(a))
  for i in range(len(a)):
    print(a[i][0], a[i][1])
  
  

### FIXED CODE ###

from operator import mul
from functools import reduce

def cmb(n,r):
  if n < r:
    return 0
  else:
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under

N, K = map(int, input().split())
ma = (N-1)*(N-2)/2

if ma < K:
  print('-1')
else:
  cmb_val = cmb(N-1,2)
  a =[(1, i) for i in range(2, N+1)]
  b = [(i, j) for i in range(2, N+1) for j in range(i+1, N+1)]
  a.extend(b[:cmb_val-K])
      
  print(len(a))
  for i in range(len(a)):
    print(a[i][0], a[i][1])
import numpy
#while True:
#   try:
#        a,b,c,d,e,f = (int(i) for i in input().split())
#        x,y = [numpy.dot(numpy.linalg.inv(numpy.array([[a,b],[d,e]])),numpy.array([c,f]))[0],numpy.dot(numpy.linalg.inv(numpy.array([[a,b],[d,e]])),numpy.array([c,f]))[1]]
#        print("{0:.3f} {1:.3f}".format(x,y))
#    except EOFError:
#        break

### FIXED CODE ###

while True:
    try:
        a,b,c,d,e,f = (int(i) for i in input().split())
        det=a*e-b*d
        x = (c*e-b*f)/det
        y = (a*f-c*d)/det
        if x==0:x=0
        if y==0:y=0
        print("{0:.3f} {1:.3f}".format(x,y))
    except EOFError:
        break
class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)
        self.size = [1] * (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 x == y:
            return

        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

    # 同じ集合に属するか判定
    def same_check(self, x, y):
        return self.find(x) == self.find(y)

N=int(input())
X=[]
Y=[]
for i in range(N):
    x,y=map(int,input().split())
    X.append((x,i))
    Y.append((y,i))
X.sort()
Y.sort()
E=[]
ans=0
count=1
for i in range(N-1):
    a=X[i]
    b=X[i+1]
    c=Y[i]
    d=Y[i+1]
    E.extend([(b[0]-a[0],X[i][1],X[i+1][1]),(d[0]-c[0],Y[i][1],Y[i+1][1])])
E.sort()

U=UnionFind(N)
i=0
while(count<N):
    cost,v1,v2=E[i]
    if not U.same_check(v1,v2):
        U.union(v1,v2)
        ans+=cost
        count+=1
    i+=1
print(ans)


### FIXED CODE ###

X,A,B=map(int,input().split())
if B-A>X:
    print("dangerous")
elif B-A>0:
    print("safe")
else:
    print("delicious")
import collections
a = int(input())
l = []
for i in range(a):
    l.append(input())
counted = collections.Counter(l)
 
m = max(counted.values())
 
chars = [key for key, value in counted.items()
             if value == m].sort()
chars.sort()

for i in chars:
    print(i)

### FIXED CODE ###

import collections
a = int(input())
l = []
for i in range(a):
    l.append(input())
counted = collections.Counter(l)
 
m = max(counted.values())
 
chars = [key for key, value in counted.items()
             if value == m]
chars.sort()
 
for i in chars:
    print(i)
N, W = list(map(int, input().split()))

weight = []
value = []

for i in range(N):
    w, v = list(map(int, input().split()))
    weight.append(w)
    value.append(v)

dp = [0] * (W+1)

for i in range(N+1):
    dp.append([])
    for j in range(W+1):
        dp[i].append(0)


# max value = dp[何個まで見たか][現在の重さ]
for i in range(N):
    for j in range(W+1):
        if (j+weight[i]) <= W:
            dp[i+1][j+weight[i]] = max(dp[i][j+weight[i]], dp[i][j] + value[i])

        dp[i+1][j] = max(dp[i][j],dp[i+1][j])

print(dp[N][W])


### FIXED CODE ###

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

weight = []
value = []

for i in range(N):
    w, v = list(map(int, input().split()))
    weight.append(w)
    value.append(v)


dp = []

for i in range(N+1):
    dp.append([])
    for j in range(W+1):
        dp[i].append(0)


# max value = dp[何個まで見たか][現在の重さ]
for i in range(N):
    for j in range(W+1):
        if (j+weight[i]) <= W:
            dp[i+1][j+weight[i]] = max(dp[i][j+weight[i]], dp[i][j] + value[i])

        dp[i+1][j] = max(dp[i][j],dp[i+1][j])

print(dp[N][W])
N,X = map(int,input().split())
towns = list(map(int,input().split()))
towns.append(X)
towns.sort()
town_diff = [0]*(len(towns)-1)
for i in range(len(towns)-1):
    town_diff[i] = towns[i+1]-towns[i]
town_diff.sort()
status = ''
a = town_diff[0]
b = town_diff[1]
for i in range(len(town_diff)-2):
    while(True):
        t = b%a
        if(t == 0):
            gcd = a
            break
        b = a
        a = t
    a = gcd
    b = town_diff[i+2]
print(gcd)

### FIXED CODE ###

N,X = map(int,input().split())
towns = list(map(int,input().split()))
towns.append(X)
towns.sort()
town_diff = [0]*(len(towns)-1)
for i in range(len(towns)-1):
    town_diff[i] = towns[i+1]-towns[i]
town_diff.sort()
if(len(town_diff) == 1):
    gcd = town_diff[0]
elif(len(town_diff) == 2):
    a = town_diff[0]
    b = town_diff[1]
    while(True):
            t = b%a
            if(t == 0):
                gcd = a
                break
            b = a
            a = t
else:
    a = town_diff[0]
    b = town_diff[1]
    for i in range(len(town_diff)-2):
        while(True):
            t = b%a
            if(t == 0):
                gcd = a
                break
            b = a
            a = t
        a = gcd
        b = town_diff[i+2]
print(gcd)
import sys

sys.setrecursionlimit(10000)

s = input()
x, y = [int(x) for x in input().split()]

d = (
    (1, 0),
    (0, 1),
    (-1, 0),
    (0, -1),
)

def next_dr(dr):
    def fix(dr):
        if dr == -1:
            return 3
        if dr == 4:
            return 0
        return dr
    return fix(dr - 1), fix(dr + 1)

def dfs(s, a, b, dr):
    # print("===")
    # print(s)
    # print(a, b)
    # print(dr)
    # print(x == a and y == b)

    if s == '':
        return x == a and y == b

    if s[0] == 'F':
        dx, dy = d[dr]
        a += dx
        b += dy
        return dfs(s[1:], a, b, dr)
    else:
        next_dr1, next_dr2 = next_dr(dr)
        return dfs(s[1:], a, b, next_dr1) or dfs(s[1:], a, b, next_dr2)

ans = "Yes" if dfs(s, 0, 0, 0) else "No"
print(ans)


### FIXED CODE ###

import math
a, b = [int(x) for x in input().split()]
print(math.ceil((a + b) / 2))
A, B, C, D, E, F = list(map(int, input().split()))

cap = 0
sug = 0

def G(a, b):
  while b > 0:
    a, b = b, a%b
  return a
def L(a, b):
  return a * b // G(a, b)


caps = {(N * 100 * A + M * 100 * B) for N in range(1 + F // (100 * A)) for M in range(1 + (F - N * 100 * A) // (100 * B))}
print(caps)

res = [0,0,0]
for water in caps:
    if water == 0: continue
    capp = min(F - water, E * water // 100)
    resug = capp % L(C, D)  
    cosug = capp - resug
    sugers = [(N * C + M * D + cosug) for N in range(resug // C + 1) for M in range((resug - N * C)//D + 1)]
    print(water, sugers)
    suger = max(sugers)
    ratio = suger / (water + suger)
    if res[0] < ratio: res = [ratio, suger + watter, suger] 


print(res[1], res[2])    


### FIXED CODE ###


import sys
from collections import deque
import bisect
import copy
import heapq
import itertools
import math
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


def main():
    A, B, C, D, E, F = read_values()
    W = set()
    
    for a in range(F // (A * 100) + 1):
        for b in range(F // (B * 100) + 1):
            w = a * 100 * A + b * 100 * B
            if 0 < w <= F:
                W.add(w)

    S = set()
    for c in range(F // C + 1):
        for d in range(F // D + 1):
            s = c * C + d * D
            if 0 <= s <= F:
                S.add(s)
    S = sorted(list(S))
    
    s, t = 0, 100 * A
    for w in W:
        p = min(F - w, math.ceil(E * w / 100))
        f = S[bisect.bisect_right(S, p) - 1]
        if f * 100 > E * w:
            continue

        if s * (w + f) < t * f:
            s, t = f, w + f
    print(t, s)


if __name__ == "__main__":
    main()
X,Y = map(int,input().split())
if Y % 2 == 0 and X * 4 >= Y and X * 2 <= Y:
    print("Yes")
else 
    print("No")

### FIXED CODE ###

X,Y = map(int,input().split())
if Y % 2 == 0 and X * 4 >= Y and X * 2 <= Y:
    print("Yes")
else:
    print("No")
#encoding utf-8

n = int(input())
v = list(int(i) for i in input().split())


v_odd = []
v_even = []
for i in range(n):
    if i%2 == 0:
        v_odd.append(v[i])
    else:
        v_even.append(v[i])

#odd part
count={}
for i in range(len(v_odd)):
    if v_odd[i] in count.keys():
        count[v_odd[i]] += 1
    else:
        count[v_odd[i]] = 1



for k, v in sorted(count.items(), key=lambda x: -x[1]):
    pass
keys = list(count.keys())
# num_odd = len(v_odd)-int(count[keys[0]])


#even part
even_count={}

for i in range(len(v_even)):
    if v_even[i] in even_count.keys():
        even_count[v_even[i]] += 1
    else:
        even_count[v_even[i]] = 1


for k, v in sorted(even_count.items(), key=lambda x: -x[1]):
    pass
even_keys = list(even_count.keys())
# num += len(v_even)-int(count[even_keys[0]])


if even_keys[0] == keys[0]:
    if len(keys) == 1 and len(even_keys) == 1:
        answer = int(len(v_odd))
    elif len(keys) == 1:
        answer = len(v_even)-int(even_count[even_keys[1]])
    elif len(even_keys) == 1:
        answer = len(v_odd)-int(count[keys[1]])
    else:
        if int(v_even[even_keys[0]]) >= int(v_odd[keys[0]]):
            answer = len(v_odd)-int(count[keys[1]])
            answer += len(v_even)-int(even_count[even_keys[0]])
        else:
            answer = len(v_odd)-int(count[keys[0]])
            answer += len(v_even)-int(even_count[even_keys[1]])

else:
    answer = n-int(count[keys[0]])-int(even_count[even_keys[0]])
print(int(answer))


### FIXED CODE ###

from collections import Counter
def main(n,v):
    # n = int(input())
    # v = list(map(int, input().split()))
    odd = Counter(v[0::2]).most_common(2) + [(0, 0)]
    even = Counter(v[1::2]).most_common(2) + [(0, 0)]

    n_half = int(n / 2)

    if (len(odd) == 1 and len(even) == 1) and odd[0][0] == even[0][0]:
        ans = n_half
    elif odd[0][0] == even[0][0]:
        ans = min(n_half - odd[0][1] + n_half - even[1][1],\
                n_half - odd[1][1] + n_half - even[0][1])
    else:
        ans = n_half - odd[0][1] + n_half - even[0][1]

    print(ans)
    return 0

if __name__ == "__main__":
    n = int(input())
    v = list(map(int, input().split()))
    main(n,v)
import sys

for line in sys.stdin:
    A=line.split()
    B=map(int,A)

D=B.sort()
e=1

while e != 0:
    e=D[1]%D[0]
    C=[0]
    D[0]=e
    D[1]=C

print e

### FIXED CODE ###

A=map(int,raw_input().split())
A.sort()

while A[1]%A[0]!=0:
    temp=A[0]
    A[0]=A[1]%A[0]
    A[1]=temp

print A[0]
m1, d1 = input().split()
m1, d2 = input().split()
d2 = int(d2)
result = 0

if d2 == 1
  result = 1
print(result)

### FIXED CODE ###

m1, d1 = input().split()
m1, d2 = input().split()
d2 = int(d2)
result = 0

if d2 == 1:
  result = 1
print(result)
def main():
    a,b = input().split()
    a = int(a)
    b_n = b[0]
    b_ = b[2:]
    ans = a*int(b_n)
    c = str(int(b_)*a)[:-2]
    print(int(ans+int(c)))

if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    a,b = input().split()
    b = b[0] + b[2:]
    print(int(a)*int(b)//100)

if __name__ == "__main__":
    main()
import numpy as np

a = input()
b = input()

a = int(a)
b = int(b)
if a > 8:
    print(':(')

elif b > 8:
    print(':(')

elif a+b > 16:
    print(":(")

else:
    print("Yay!")


### FIXED CODE ###

c = input().split()

a = int(c[0])
b = int(c[1])

if a > 8:
    print(':(')

elif b > 8:
    print(':(')

elif a+b > 16:
    print(":(")

else:
    print("Yay!")
N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
ans=[]
for i in range(len(h)-K+1):
  b=h[K+1-i]-h[i]
  ans.append(b)
print(min(b))

### FIXED CODE ###

N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
ans=[]
for i in range(len(h)-K+1):
  b=h[K+i-1]-h[i]
  ans.append(b)
print(min(ans))
print('Even' if any(n % 2 == 0 for n in map(int, input().split()) else 'Odd')

### FIXED CODE ###

print('Even' if any(n % 2 == 0 for n in map(int, input().split())) else 'Odd')
n = int(input())
s = input()
i = 0
count = 0

while i < n:
    if s[i] == 'A':
        if s[i+1] == 'B':
            if s[i+2] == 'C':
                count += 1
                i += 2
    i += 1

print(count)

### FIXED CODE ###

n = int(input())
s = input()

print(s.count('ABC'))
import numpy as np
a,b,c=map(int, input().split())
if np.sqrt(a)+np.sqrt(b)<np.sqrt(c):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k=int(input())
print(a[k-1])
h,n = map(int,input().split())
a = [list(map(int,input().split()))for _ in range(n)]
z1 = [0,0]
z2 = [w,h]
for i in range (n):
    if a[i][2] == 1 and z1[0] <= a[i][0]:
        z1[0] = a[i][0]
    elif a[i][2] == 2 and z2[0] >= a[i][0]:
        z2[0] = a[i][0]
    elif a[i][2] == 3 and z1[1] <= a[i][1] :
        z1[1] = a[i][1]
    elif a[i][2] == 4 and z2[1] >= a[i][1] :
        z2[1] = a[i][1]
if z2[0] > z1[0] and z2[1] > z1[1]:
    print((z2[0]-z1[0])*(z2[1]-z1[1]))
else:
    print(0)

### FIXED CODE ###

w,h,n = map(int,input().split())
a = [list(map(int,input().split()))for _ in range(n)]
z1 = [0,0]
z2 = [w,h]
for i in range (n):
    if a[i][2] == 1 and z1[0] <= a[i][0]:
        z1[0] = a[i][0]
    elif a[i][2] == 2 and z2[0] >= a[i][0]:
        z2[0] = a[i][0]
    elif a[i][2] == 3 and z1[1] <= a[i][1] :
        z1[1] = a[i][1]
    elif a[i][2] == 4 and z2[1] >= a[i][1] :
        z2[1] = a[i][1]
if z2[0] > z1[0] and z2[1] > z1[1]:
    print((z2[0]-z1[0])*(z2[1]-z1[1]))
else:
    print(0)
# N：人数 M：種類
# K1：個 A1 A2 ...：好きな食べ物の数字
# K2 A1 A2
# 全員が好きな食べ物の種類数

N, M = map(int, input().split())
s = set(range(1, M+1))

for _ in range(N):
    k, *a = map(int, input().split())
    if len(s) == 0:
        s = a
    s&=set(a)
print(len(s))

### FIXED CODE ###

# N：人数 M：種類
# K1：個 A1 A2 ...：好きな食べ物の数字
# K2 A1 A2
# 全員が好きな食べ物の種類数

N, M = map(int, input().split())
s = set(range(1, M+1))

for _ in range(N):
    k, *a = map(int, input().split())
    s&=set(a)
print(len(s))
import sympy

n=int(input())
abc=n
ans=0
for c in range(1,n):
  ab=abc-c
  ans+=len(sympy.divisors(ab))

print(ans)

### FIXED CODE ###

n=int(input())
ans=0
for i in range(1,n):
  ans+=(n-1)//i
print(ans)
n = input()
ans1=sum(int(i)for i in n)
ans2=int(n[0])-1+9*(len(n)-1)
print(max(ans1,ans2)

### FIXED CODE ###

n = input()
ans1=sum(int(i)for i in n)
ans2=int(n[0])-1+9*(len(n)-1)
print(max(ans1,ans2))
from math import factorial

n,k = map(int,input().split())
mod = 10**9+7

def comb(n,r):
    return factorial(n) / (factorial(r) * factorial(n-r))

for i in range(1,k+1):
    if i > n-k+1:
        print(0)
    else:
        x = comb(k-1,i-1) % mod
        y = comb(n-k+1,i) % mod
        print(x*y % mod)


### FIXED CODE ###

from math import factorial

n,k = map(int,input().split())
mod = 10**9+7

def cmb(n,r):
    return factorial(n) // (factorial(r) * factorial(n-r))

for i in range(1,k+1):
    if n-k+1 < i or k-1 < i-1:
        print(0)
    else:
        x = cmb(k-1,i-1) % mod
        y = cmb(n-k+1,i) % mod
        ans = (x*y) % mod
        print(int(ans))
n=int(input())
i=1
while i^2<=N:
    i+=1
print(N-1)

### FIXED CODE ###

n=int(input())
i=1
while i*i<=n:
    i+=1
print((i-1)*(i-1))