Harryxun/stf_run huggingface dataset:
x,k,d=map(int,input().split())
if x==0:
	if k%2==0:
		print(0)
	else:
		print(d)
    exit(0)
t=abs(x//d)
if (k<=t):
	if (x>0):
		print(x-k*d)
	else:
		print(x+k*d)
	exit(0)
else:
	if (x>0):
		x=x-t*d
		k-=t
		if k%2==0:
			print(x)
		else:
			print(abs(x-d))
	else:
		x=x+t*d
		k-=t
		if k%2==0:
			print(abs(x))
		else:
			print(abs(x+d))

### FIXED CODE ###

from math import floor
import decimal
x,k,d=map(int,input().split())
if x==0:
	if k%2==0:
		print(0)
	else:
		print(d)
	exit(0)	
with decimal.localcontext() as ctx:
    ctx.prec = 150
    t=floor(decimal.Decimal(abs(x))/decimal.Decimal(d))
    

if (k<=t):
	if (x>0):
		print(abs(x-k*d))
	else:
		print(abs(x+k*d))
else:
	if (x>0):
		x=x-t*d
		k-=t
		if k%2==0:
			print(abs(x))
		else:
			print(abs(x-d))
	else:
		x=x+t*d
		k-=t
		if k%2==0:
			print(abs(x))
		else:
			print(abs(x+d))
if a == 1 or b == 1:
  print(1)
def prime(n):
  pf=[1]
  for i in range(2,int(n**0.5)+1):
    while n%i==0:
      pf.append(i)
      n//=i
  list(set(pf))
  return pf
a, b = map(int, input().split())
if a == 1 or b == 1:
  print(1)
else:
  print(len(set(prime(a)+prime(b))))

### FIXED CODE ###

import sys 
input = sys.stdin.readline
a, b = map(int, input().split())
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

A = set(prime_factorize(a))
B = set(prime_factorize(b))
ans = A&B
print(len(ans)+1)
L,R=map(int, input().split())
LR = range(L,R+1)
from itertools import permutations, combinations,combinations_with_replacement,product
C = combinations(LR, 2)
Ret = 2019
for i in C:
  Ret = min(Ret,(i[0]*i[1])%2019)
print(Ret)

### FIXED CODE ###

L,R=map(int, input().split())
LR = range(L,R+1)
from itertools import permutations, combinations,combinations_with_replacement,product
if (R+1-L)<2019:
  C = combinations(LR, 2)
  Ret = 2019
  for i in list(C):
    Ret = min(Ret,(i[0]*i[1])%2019)
else:
  Ret = 0
print(Ret)
import sys

"""テンプレ"""

# 高速
input = sys.stdin.readline

# 1行を空白でリストにする(int)
def intline():
    return list(map(int, input().split()))


# 上のstrヴァージョン
def strline():
    return list(map(str, input().split()))


# 1列に並んだ数
def intlines(n):
    return [int(input() for _ in range(n))]


# 上の文字列ヴァージョン
def lines(n):
    return [input() for _ in range(n)]
    

"""ここからメインコード"""

k = intline().sort()
if k = [1, 4, 7, 9]:print("YES")
else:print("NO")

### FIXED CODE ###

a, b, c, d = map(int, input().split())
k = [a, b, c, d]
k.sort()

if [1, 4, 7, 9] == k:
    print("YES")
else:
    print("NO")
import collections
N,M=map(int,input().split())

counter=collections.defaultdict
for _ in range(N):
  text = list(input().split())
  for x in text[1:]:
    counter[x]+=1
ans=0
for _ in counter:
  if counter[x]== N:
    ans+=1
print(ans)

### FIXED CODE ###

import collections
N,M=map(int,input().split())

counter=collections.defaultdict(int)
for _ in range(N):
  text = list(input().split())
  for x in text[1:]:
    counter[x]+=1
ans=0
for x in counter:
  if counter[x]== N:
    ans+=1
print(ans)
import sys

H, W, M = map(int, sys.stdin.readline().split())
hlst = [0]*(H+1)
wlst = [0]*(M+1)
hwlst = []

for i in range(M):
    h, w = map(int, sys.stdin.readline().split())
    hlst[h] += 1
    wlst[w] += 1
    hwlst.append([h,w])

hmax = max(hlst)
wmax = max(wlst)
ans = 0
c = True
i = 0
for i in range(H+1):
    if hlst[i] == hmax:
        for j in range(W+1):
            if wlst[j] == wmax:
                if [i, j] in hwlst:
                    ans = hmax + wmax -1
                else:
                    ans = hmax + wmax

print(ans)


### FIXED CODE ###

import sys
H, W, M = map(int, sys.stdin.readline().split())
hlst = {}
wlst = {}
hwlst = []

for i in range(M):
    h, w = sys.stdin.readline().split()
    if h in hlst:
        hlst[h] += 1
    else:
        hlst[h] = 1

    if w in wlst:
        wlst[w] += 1
    else:
        wlst[w] = 1

    hwlst.append([h, w])

h = max(hlst.values())
w = max(wlst.values())
hmax = [i for i in hlst if hlst[i] == h]
wmax = [i for i in wlst if wlst[i] == w]
num = len(hmax)*len(wmax)
ans = h + w -1


for i in hwlst:
    if hlst[i[0]] == h and wlst[i[1]] == w:
        num -= 1

if num == 0:
    print(h+w-1)
else:
    print(h+w)
import sys

a = sys.argv[1]
b = sys.argv[2]

if (a + b) % 2 == 0:
  print("Even")
else:
  print("Odd")

### FIXED CODE ###

import sys

a, b = [int(v) for v in sys.stdin.read().split(" ")]
if (a * b) % 2 == 0:
  print("Even")
else:
  print("Odd")
from math import *
from itertools import permutations
n = int(input())
p = list(permutations(list(range(1,n+1))))
a = (int(i) for i in input().split())
b = (int(i)for i in input().split())
print(abs(p.index(a) - p.index(b)))

### FIXED CODE ###

from math import *
from itertools import permutations
n = int(input())
p = list(permutations(list(range(1,n+1))))
a = tuple([int(i) for i in input().split()])
b = tuple([int(i)for i in input().split()])
print(abs(p.index(a) - p.index(b)))
n, p = list(map(int, input().split()))
s = input()

count = 0
res = [s[i:j] for i in range(n) for j in range(i+1, n+1)] 

for ss in res:
  if(int(ss) % p == 0):
      count += 1
print(count)

### FIXED CODE ###

import numpy as np

def a():
  n, p = list(map(int, input().split()))
  num = [int(s) for s in input()]
  
  if(p==2 or p==5):
    count=0
    for i in range(1,n+1):
      if(num[-i]%p == 0):
        count += n-i+1
    print(count)
    return
  
  counts = np.zeros(p)
  tmp = 0
  tens = 1
  for i in range(1,n+1):
    tmp = (tens*num[-i] + tmp) % p
    counts[tmp] += 1
    tens = (tens*10)%p
  ret = int(counts[0] + sum(counts*(counts-1)//2))
  print(ret)
  return
a()
n,a,b=map(int,input().split())
s=''
s+='b'*a
s+='r'*b
s*=n//(a+b)+1
print(s[:n].count('b'))


### FIXED CODE ###

n,a,b=map(int,input().split())
ans = n // (a + b) * a
rem = n % (a + b)
ans+=min(a,rem)
print(ans)
n,k=map(int,input().split())
a=list(map(int,input().split()))
ok=set()
now=0
l=[]
while now not in ok and k:
    l.append(now)
    ok.add(now)
    now=a[now]-1
    k-=1
length=len(ok)-(h:=l.index(now))
l=l[h:]
print(l,h,length)
k=(k)%length

print(l[k]+1)

### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
ok=set()
now=0
l=[]
while now not in ok and k:
    l.append(now)
    ok.add(now)
    now=a[now]-1
    k-=1
if k==0:print(now+1);exit()
length=len(ok)-(h:=l.index(now))
l=l[h:]

k=(k)%length

print(l[k]+1)
count = {} #a~zの出現回数を記録
for i in range(26):
    count[(i)] = 0

while True:
    try:
        text = raw_input()
    except:
        break
    for i in range(len(text)):
        if(ord(text[i]) >= ord('a') and ord(text[i]) <= ord('z')):
            count[(ord(text[i]))-ord('a')] += 1
        if(ord(text[i]) >= ord('A') and ord(text[i]) <= ord('Z')):
            count[(ord(text[i]))-ord('A')] += 1

#出現回数の表示
for i in range(26):
    print '%s : %d' %(unichr(i+ord('a')), count[(i)])

### FIXED CODE ###

count = {}
for i in range(26):
    count[(i)] = 0

while True:
    try:
        x = raw_input()
    except:
        break
    for i in range(len(x)):
        if(ord('a') <= ord(x[i]) and ord(x[i]) <= ord('z')):
            count[(ord(x[i])-ord('a'))] += 1
        elif(ord('A') <= ord(x[i]) and ord(x[i]) <= ord('Z')):
            count[(ord(x[i])-ord('A'))] += 1

for i in range(26):
    print '%s : %d' %(chr(i+ord('a')), count[(i)])
exit(0)
N, M = map(int, input().split())
     
    L = []
    R = []
    LR = [int(i) for i in range(1, N+1)]
    for i in range(M):
        l, r = map(int, input().split())
        L.append(l)
        R.append(r)
        LR.append(l)
        LR.append(r)
     
    tmp = []
    for gate in range(1, M+1):
        for i in range(L[gate-1], R[gate-1]+1):
            tmp.append(i)
        tmpLR = list(set(tmp) & set(LR))
        LR.clear()
        LR = tmpLR
        tmp.clear()
     
    print(len(LR))

### FIXED CODE ###


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

L = []
R = []

for i in range(M):
    l, r = map(int, input().split())
    L.append(l)
    R.append(r)

maxl = max(L)
minr = min(R)

ans = minr - maxl + 1
if ans > 0:
    print(ans)
else:
    print(0)
N = int(input())
M = int(input())
A = list(map(int(input().split)))
a = sum(A)
if N - a >= 0:
    print(N-a)
else:
    print(-1)
    
        


### FIXED CODE ###

N,M = map(int, input().split())
A = list(map(int, input().split()))
a = sum(A)
ans = N -a
if ans >= 0:
    print(ans)
else:
    print(-1)
from fractions import gcd

N = int(input())

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

def lcm(a):
  x = a[0]
  for i in range(1, len(a)):
    x = (x * a[i]) // gcd(x, a[i])
  return x

l = lcm(A)
num=0
for a in A:
  num += l/a
print(int(num % (10e9 +7)))




### FIXED CODE ###

from fractions import gcd

N = int(input())

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

l = A[0]
for a in A:
  l = (l * a) // gcd(l,a)
num=0
for a in A:
  num += l//a
print(num % (10**9 +7))
n=int(input())
a=list(map(int,input().split()))
b=set(a)
print("YES" if n == len(b), else "NO")


### FIXED CODE ###

s,t = map(str, input().split())
a,b = map(int, input().split())
u = input()
if u == s:
    print(a-1, b)
else :
    print(a, b-1)
S = input()
S = S.split()
if ((S[2]==S[3])&(S[4]==S[5])):
	print("Yes")
else: 
    print("No")


### FIXED CODE ###

S = input()
#S = S.split()
if ((S[2]==S[3])&(S[4]==S[5])):
	print("Yes")
else: 
	print("No")
N = int(input())
ans = 0
for i in range(N):
  l, r = map(int. input().split())
  ans += (r - l + 1)
print(ans)

### FIXED CODE ###

N = int(input())
ans = 0
for i in range(N):
  l, r = map(int, input().split())
  ans += (r - l + 1)
print(ans)
A, B, C = int(input())
if A == 5 and B == 5 and C == 7:
  print("YES")
elif A == 5 and B == 7 and C == 5:
  print("YES")
elif A == 7 and B == 5 and C == 5:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

A,B,C = map(int, input().split())
if A==5 and B==5 and C==7:
  print("YES")
elif A==5 and B==7 and C==5:
  print("YES")
elif A==7 and B==5 and C==5:
  print("YES")
else:
  print("NO")
#失恋してメンタル死んでるのでコードもシンデマス

dic = {}
key = []
item = []

for i in range(3):
    a,b = map(int,input().split())
    dic[a] = b
    key.append(a)
    item.append(b)

for i in key:
    flag = True
    tmp_key = key
    tmp_item = item
    
    a = i
    while flag:
        if a in key:
          a = dic[a]
            tmp_key.remove(a)
            tmp_item.remove(dic[a])
            
        else:
            flag = False
        
    if len(tmp_item) == 0 and len(tmp_key) == 0:
        res = "YES"
        res_flag = False
if res_flag:
  res = "NO"

print(res)
 
        
        

### FIXED CODE ###

N,K = map(int,input().split())
N = (N+1)//2
 
if N >= K:
  res = "YES"
else:
  res = "NO"

print(res)
x = int(input())
ar = list(map(int, input().split()))
sum_val = sum(ar)

unique_val = dict()

for i in ar:
    if i in unique_val:
        unique_val[i] += 1
    else:
        unique_val[i] = 1

q = int(input())
while(q):
    a, b = map(int, input().split())
    if a in unique_val:
        value = (b-a)*unique_val[a]
        sum_val += value
        if b in unique_val:
            unique_val[b] = unique_val[b] + unique_val.pop(a)
        else:
            unique_val[b] = unique_val.pop(a)
        print(unique_val)
        
    print(sum_val)
    q -= 1

print(sum_val)

### FIXED CODE ###

x = int(input())
ar = list(map(int, input().split()))
sum_val = sum(ar)

unique_val = dict()

for i in ar:
    if i in unique_val:
        unique_val[i] += 1
    else:
        unique_val[i] = 1

q = int(input())
while(q):
    a, b = map(int, input().split())
    if a in unique_val:
        value = (b-a)*unique_val[a]
        sum_val += value
        if b in unique_val:
            unique_val[b] = unique_val[b] + unique_val.pop(a)
        else:
            unique_val[b] = unique_val.pop(a)
        #print(unique_val)
        
    print(sum_val)
    q -= 1
import numpy as np
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

N, M = map(int, input().split())
A = np.array(list(map(int, input().split())))
tot = np.sum(A)

if tot > N:
	print(-1)
else:
	print(N-tot)

### FIXED CODE ###

import numpy as np
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

N = int(input())
A = np.array(list(map(int, input().split())), dtype=np.int64)
cnt = np.zeros(N+1, dtype=np.int64)

for a in A:
	cnt[a] += 1

for c in cnt[1:]:
	print(c)
A = int(input())
B = int(input())
if A-B < A+B and A*B < A+B:
  print(A+B)
elif A+B < A-B and A*B < A-B:
  print(A-B)
else:
  print(A*B)

### FIXED CODE ###

a, b = map(int, input().split())
print(max(a+b, a-b, a*b))
import collections

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

c = collections.Counter(d)

jug = True
for i in range(max(d) + 1):
    if i not in c:
        jug = False

c = sorted(c.items(), key=lambda x:x[0])

ans = 1

if c[0][0] != 0:
    jug = False
else:
    for i in range(max(d)):
        if c[i][0] < 0:
            jug == False
        else:
            m = c[i][1]
            r = c[i+1][1]
            ans *= m ** r
            ans %= 998244353
            if ans == 0:
                jug = False
  
if jug == False:
    print(0)
else:
    print(ans)

### FIXED CODE ###

import collections

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

c = collections.Counter(d)

ans = 1

if c[0] != 1 or d[0] !=0:
    ans = 0

for i in range(max(d) + 1):
    if i == 0:
        continue
    ans *= c[i-1] ** c[i]

print(ans%998244353)
H,W=map(int,input().split())
st=set()
list=list()
for i in range(H):
    S=input()
    if S.count('.') != W:
        list.append(S)
    tmp=[*S]
    tmp=[int(i) for i,x in enumerate(tmp) if x == '.']
    if not st:
        tmp_set = set(tmp)
        st=st.union(tmp_set)
    else:
        tmp_set = set(tmp)
        st &=tmp_set
for x in list:
    str=''
    if not st:
        for i in range(W):
            str+=x[i]
    else:
        for i in range(W):
            if i not in st:
                str+=x[i]
    print(str)
    str=''

### FIXED CODE ###

H,W=map(int,input().split())
st=set()
list=list()
for i in range(H):
    S=input()
    if S.count('.') != W:
        list.append(S)
    tmp=S
    tmp=[int(i) for i,x in enumerate(tmp) if x == '.']
    if not st:
        tmp_set = set(tmp)
        st=st.union(tmp_set)
    else:
        tmp_set = set(tmp)
        st &=tmp_set
for x in list:
    str=''
    if not st:
        for i in range(W):
            str+=x[i]
    else:
        for i in range(W):
            if i not in st:
                str+=x[i]
    print(str)
    str=''
import  scipy as sp 
from itertools import permutations
n,m,r=map(int, input().split())
s=[[10**9]*n for i in range(n)]
t=list(map(int, input().split()))
for i in range(m):
    a,b,c=map(int, input().split())
    s[a-1][b-1]=c
    s[b-1][a-1]=c

s=sp.sparse.csgraph.floyd_warshall(s)   
ans=float('inf')
for i in permutations(t):
    an=0
    for j in range(r-1):
        an+=s[i[j]-1][i[j+1]-1]
    ans=min(ans,an)
print(ans)

### FIXED CODE ###

n,m,r=map(int, input().split())
s=[[10**9]*n for i in range(n)]
t=list(map(int, input().split()))
for i in range(m):
    a,b,c=map(int, input().split())
    s[a-1][b-1]=c
    s[b-1][a-1]=c
 
for k in range(n):
    for i in range(n):
        for j in range(n):
            s[i][j]=min(s[i][j],s[i][k]+s[k][j])
ans=float('inf')
from itertools import permutations
for i in permutations(t):
    an=0
    for j in range(r-1):
        an+=s[i[j]-1][i[j+1]-1]
    ans=min(ans,an)
print(ans)
def N():
    return int(input())
def L():
    return list(map(int,input().split()))
def NL(n):
    return [list(map(int,input().split())) for i in range(n)]
mod = pow(10,9)+7
#import numpy
#import sympy
import math
def divisors(n):
    num = 0
    for i in range(1, int(math.sqrt(n) + 1)):
        if n % i == 0:
            num += 1
            if n != i**2:
                num += 1
    
    return num
n = N()
cnt = 0
for i in range(1,n):
    ab = n-i
    cnt += divisors(ab)
print(cnt)

### FIXED CODE ###

def N():
    return int(input())
def L():
    return list(map(int,input().split()))
def NL(n):
    return [list(map(int,input().split())) for i in range(n)]
mod = pow(10,9)+7
#import numpy

s =input()
l = len(s)
if s[l-1] == 's':
    print(s + 'es')
else:
    print(s + 's')
N=int(input())
p=list(map(int,input().split()))
false_num=0
for i in range(N-1):
    if p[i]+1==p[i+1]:
        continue
    else:
        false_num+=1

if false_num=0 or 2:
    print('YES')
else:
    print('NO')


    
        

### FIXED CODE ###

N=int(input())
p=list(map(int,input().split()))
false_num=0
for i in range(N):
    if p[i] != i+1:
        
        false_num+=1

if false_num==0 or false_num==2:
    print('YES')
else:
    print('NO')
N = int(input())
import numpy as np
A = [0]*N
B = [0]*N
for i in range(N):
    A[i], B[i] = map(int,input().split())
na = np.median(A)
nb = np.median(B)
if N%2 == 1:
    ans = int(nb - na + 1)
    print(ans)
    exit()
else:
    ans = 2*int(nb - na) + 1
    print(ans)
    exit()


### FIXED CODE ###

N = int(input())
import numpy as np
A = [0]*N
B = [0]*N
for i in range(N):
    A[i], B[i] = map(int,input().split())
na = np.median(A)
nb = np.median(B)
if N%2 == 1:
    ans = int(nb - na + 1)
    print(ans)
    exit()
else:
    ans = int(2*(nb - na)) + 1
    print(ans)
    exit()
a, b = map(int,input().split())
 
if 1<=a=<9 and 1<=b<=9:
  print(a*b)
else:
  print("-1")

### FIXED CODE ###

a, b = map(int,input().split())
if 1 <= a <= 9 and 1 <= b <= 9:
    print(a*b)
else:
    print(-1)
n,m=map(int,input().split())
P=[[] for _ in range(n+1)]
for i in range(m):
    p,y=map(int,input().split())
    P[p].append([y,i+1])
ans=[]
for j in range(m):
    if P[j]:
        P[j].sort()
        for i in range(len(P[j])):
            #print(P[j])
            ans.append([P[j][i][1],str((j*10**6+i+1)).zfill(12)])
ans.sort()
for i in range(m):
    print(ans[i][1])


### FIXED CODE ###

n,m=map(int,input().split())
P=[[] for _ in range(n+1)]
for i in range(m):
    p,y=map(int,input().split())
    P[p].append([y,i+1])
ans=[]
for j in range(n+1):
    if P[j]:
        P[j].sort()
        for i in range(len(P[j])):
            #print(P[j])
            ans.append([P[j][i][1],str((j*10**6+i+1)).zfill(12)])
ans.sort()
for i in range(m):
    print(ans[i][1])
chr = input()

print ord(chr)

### FIXED CODE ###

chr  = input();
ans = 'A' if ord(chr) >=65 and ord(chr) <= 90 else 'a'
print(ans)
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    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)]


N, M=map(int,input().split())
UF=UnionFind(N)

for _ in range(M):
    A,B=map(int,input().split())
    UF.union(A,B)

ans=0

for i in range(N):
    ans = max(ans, UF.size(i))
 
 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)]


N, M = map(int, input().split())
UF = UnionFind(N)

for _ in range(M):
    A, B = map(int, input().split())
    UF.union(A - 1, B - 1)

ans = 0

for i in range(N):
    ans = max(ans, UF.size(i))

print(ans)
def dfs(i,s,res):
    if i==3:
        if res == 7:
            return s
        elif:
            exit()
    dfs(i+1,s+'+'+S[i+1],res+int(S[i+1]))
    dfs(i+1,s+'-'+S[i+1],res-int(S[i+1]))

S=input()
print(dfs(0,S[0],int(S[0]))+"=7")


### FIXED CODE ###

def dfs(i, Str, res):
    if i==3:
        if res==7:
            print(Str+"=7")
            exit()
        return
    
    dfs(i+1,Str+"+"+s[i+1],res+int(s[i+1]))
    dfs(i+1,Str+"-"+s[i+1],res-int(s[i+1]))

s=input()
dfs(0,s[0],int(s[0]))
n = input()
A = map(int, raw_input().split())
q = input()
m = map(int, raw_input().split())

def solve(i, m):
 if m == 0:
  return true
 if i >= n:
  return false
 res = solve(i + 1, m) or solve(i + 1, m - A(i))
 return res

for j in range(0, q):
 if solve(0, m(j)):
  print "yes"
 else:
  print "no"

### FIXED CODE ###

n = input()
A = map(int, raw_input().split())
q = input()
m = map(int, raw_input().split())

def solve(i, m):
 if m == 0:
  return True
 if i >= n or m > sum(A):
  return False
 res = solve(i+1, m) or solve(i+1, m-A[i])
 return res

for j in range(0, q):
 if solve(0, m[j]):
  print 'yes'
 else:
  print 'no'
x,y = map(int,input().split())
a = int(input())
ans = 2*a + 4(x-a)
if ans == y:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

x,y = map(int,input().split())
#2a+4b = y
#x = a+b
#x-a = b
#2a+4(x-a) = y
#y = 4x-2a

for i in range(x+1):
  if y == 4*x - 2*i:
    print('Yes')
    break
else:
  print('No')
N,M = map(int,input().split())
a = []
for i in range(M):
    a.append(int(input()))

def fibo(n):
    a, b = 1, 1
    if (n == 0) or (n == 1) or (n == 2):
        return 1
    else:
        for _ in range(n-2):
            a, b = b, a + b
        return b

aa = [] #aの差を取ったもののリスト
for k in range(M-1):
    aa.append(a[k+1] - a[k] - 1)
#print(aa)
#aa.append(N - a(M))

if 0 in aa:
    ans = 0

else:
    ans = 1
    ans_list = []
    for i in range(M-1):
        ans_list.append(fibo(aa[i]))

    ans_list.append(fibo(a[0]))
    ans_list.append(fibo(N - a[M-1]))
    #print(ans_list)
    
    for i in range (len(ans_list)):
        ans = (ans * ans_list[i]) % (10**9 + 7)

print(ans)


### FIXED CODE ###

N,M = map(int,input().split())
a = []
if M >= 1:
    for i in range(M):
        a.append(int(input()))

def fibo(n):
    a, b = 1, 1
    if (n == 0) or (n == 1) or (n == 2):
        return 1
    else:
        for _ in range(n-2):
            a, b = b, a + b
        return b

aa = [] #aの差を取ったもののリスト
if M >= 2:
    for k in range(M-1):
        aa.append(a[k+1] - a[k] - 1)
#print(aa)
#aa.append(N - a(M))

    if 0 in aa:
        ans = 0

    else:
        ans = 1
        ans_list = []
        for i in range(M-1):
            ans_list.append(fibo(aa[i]))

        ans_list.append(fibo(a[0]))
        ans_list.append(fibo(N - a[M-1]))
    #print(ans_list)
    
        for i in range (len(ans_list)):
            ans = (ans * ans_list[i]) % (10**9 + 7)

elif M == 1:
    ans_list = []
    ans_list.append(fibo(a[0]))
    ans_list.append(fibo(N - a[0]))
    ans = (ans_list[0] * ans_list[1]) % (10**9 + 7)

elif M == 0:
    ans = fibo(N+1) % (10**9 + 7)

print(ans)
a=int(input())
b=list(input())
c=0
for i in range(a):
  if b[i]=="A":
    if b[i+1]=="B":
      if b[i+2]=="C":
        c+=1
        continue
      
print(c)


### FIXED CODE ###

n=int(input())
s=list(input())
d=0
for i in range(n):
  if n-(i+1)>=2:
    if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
      d+=1
  else:
    pass
print(d)