peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
def gen(chars):
  a = [0] * 26
  for c in chars:
    a[ord(c) - 97] += 1
  return tuple(a)

n = int(input())
m = dict()
r = 0
for s in map(gen, [input() for _ in range(n)]):
  m[s] = m.get(s, 0) + 1
  r += m[s] - 1
print(r)
# Judge status: Accepted
import re
A,B,C = map(int,input().split())
#N = str(input())
#K = int(input())
#A = list(map(int,input().split()))
if A==B==C and A%2==0 and B%2==0 and C%2==0:
    print(-1)
    exit()
flag=True
co=0
if A%2!=0 or B%2!=0 or C%2!=0:
    flag=False
while flag==True:
    co+=1

    a=B/2 + C/2
    b=A/2 + C/2
    c=B/2 + A/2
    if a%2!=0 or b%2!=0 or c%2!=0:
        flag=False
    A=a
    B=b
    C=c

print(co)
# Judge status: Accepted
N = int(input())
if N <= 999:
    print("ABC")
else:
    print("ABD")
# Judge status: Wrong Answer
N = int(input())
x = list(map(int, input().split()))
ans=1
for i in range(N):
  ans *=x[i]

if ans > 10000000000000000000:
  ans=-1
  
print(ans)
# Judge status: Wrong Answer
n = int(input())
a_lst = list(map(int, input().split()))

res = 0
for i in range(n):
  for j in range(i+1, n):
    res += (a_lst[i] ^ a_lst[j])
print(res)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A_B = 0
B_A = 0
for i in range(N):
  if A[i] > B[i]:
    A_B += A[i] - B[i]
  else:
    B_A += B[i]- A[i]
    
if B_A < 2*A_B and not (A_B == 0 and B_A == 0):
  print('No')
else:
  print('Yes')
# Judge status: Accepted
x, y = map(int, input().split())
if x >= 0 and y >= 0 and x <= y:
  ans = y - x
elif x >= 0 and y > 0 and x >= y:
  ans = x -  y + 2
elif x <= 0 and y <= 0 and x <= y:
  ans = y - x
elif x < 0 and y <= 0 and x >= y:
  ans = x - y + 2
elif x >= 0 and y <= 0:
  ans = abs(x - abs(y)) + 1
elif x <= 0 and y >= 0:
  ans = abs(y - abs(x)) + 1
print(ans)
# Judge status: Accepted
N = int(input())
count = 0
T, X, Y = 0, 0, 0
for i in range(N): 
    t, x, y = map(int, input().split()) 
    if abs(x-X)+abs(y-Y) <= t-T and t % 2 == (x+y) % 2: 
        count += 1 
    T, X, Y = t, x, y
print("Yes" if count == N else "No")
# Judge status: Accepted
N,A,B = map(int,input().split())
if (B - A) % 2 == 0:
	print((B - A)//2)
else:
	print(min(A - 1,N - B) + 1 + (B - A - 1)//2)
# Judge status: Accepted
N, x = map(int, input().split())
a = list(map(int, input().split()))
sort_a = sorted(a)
count = 0
for y in range(len(sort_a)):
    if y != len(sort_a) - 1:
        if sort_a[y] <= x:
            x -= sort_a[y]
            count += 1
        else:
            break
    else:
        if sort_a[y] == x:
            count += 1

print(count)
# Judge status: Accepted
input()
S = input()
total = answer = 0
for c in S:
    total += (1 if c == "I" else -1)
    answer = max(answer, total)
print(answer)
# Judge status: Accepted
n = int(input())
l = []
for i in range(1,n+1):
    if i % 3 == 0 or i % 5 == 0:
        pass
    else:
        l.append(i)
print(sum(l))
# Judge status: Wrong Answer
from collections import Counter
n = int(input())
s = input()
slen = len(s)
d = Counter(s)
res = 1
for v in d.values():
    res *= v
#print(res)
for step in range(1, slen):
    for start in range(slen):
        i = start
        j = i + step
        k = j + step
        if k >= slen:
            break
        ijk = [s[i], s[j], s[k]]
        # print("ijk is", ijk)
        if 'R' in ijk and 'G' in ijk and 'B' in ijk:
            res -= 1

print(res)
# Judge status: Accepted
n=int(input())
w=list(map(int,input().split()))
ans=abs((sum(w[0:1]))-sum(w[1:n]))
for t in range(2,n):
    if abs((sum(w[0:t]))-sum(w[t:n])) < ans:
        ans = abs((sum(w[0:t]))-sum(w[t:n]))
print(ans)
# Judge status: Wrong Answer
def resolve():
    from fractions import gcd
    a, b, c, d = map(int, input().split())
    e = int(c*d/gcd(c,d))
    db = int(b - (int(b/c) + int(b/d) - int(b/e)))
    da = int((a-1) - (int((a-1)/c) + int((a-1)/d) - int((a-1)/e)))
    print(int(db-da))
resolve()
# Judge status: Wrong Answer
ans = [1,2,3]
a = int(input())
b = int(input())
ans.remove(a)
ans.remove(b)

print(ans)
# Judge status: Accepted
N, C, K = map(int, input().split())
T = sorted([int(input()) for _ in range(N)])

ans = 1
bus = 0
before = T[0]

for i in T:
    if bus+1 > C or i - before > K:
        bus = 1
        ans += 1
        before = i
    else:
        bus += 1
    
    # print(f"i{i} bus{bus} ans{ans}")
print(ans)
# Judge status: Wrong Answer
n = int(input())
s = input()
c = [0,0]
for i in range(n):
    if (s[i]=="E"):
        c[0] += 1
    else:
        c[1] += 1
#print(c)
if (c[1]==0 or c[0]==0):
    print(1)
else:
    print(min(c)-1)
# Judge status: Wrong Answer
from collections import deque as que
q=que()
n,m=map(int,input().split())
e=[[] for i in range(n)]
for i in range(m):
    a,s=map(int,input().split())
    e[a-1].append(s-1);e[s-1].append(a-1)
table=[0]*n
ok=0
table[0]=1
q.append(0)
while len(q):
    now=q.pop()
    for to in e[now]:
        if table[to]==0:
            table[to]=now+1
            q.append(to)
            ok+=1
if n-1==ok:
    print("Yes",*table[1:],sep="\n")
# Judge status: Accepted
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n,r = I()
if n < 10:
    print(100*(10-n)+r)
else:
    print(r)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

i = 0
ans = 0

while i < n:
    i1 = i
    last = a[i]
    while i1 < n:
        if last <= a[i1]:
            last = a[i1]
            i1 += 1
        else: break
    
    i2 = i
    while i2 < n:
        if last >= a[i2]:
            last = a[i2]
            i2 += 1
        else: break
    
    i = max(i1, i2)
    ans += 1

print(ans)
# Judge status: Wrong Answer
N,M=map(int,input().split())
X=list(map(int,input().split()))
Y=[]
X.sort()
ans=0
if N>=M:
    print(0)
    exit()
for i in range(M-1):
    Y.append(X[i+1]-X[i])
Y.sort(reverse=True)
for j in range(N-1):
    ans+=Y[j]-1
print(ans)

print(X[M-1]-X[0]+1-ans-N)
# Judge status: Accepted
X, Y = map(int,input().split())
cnt = 1
X *= 2
while X <= Y:
    X *= 2
    cnt += 1
print(cnt)
# Judge status: Accepted
S = input()
C = ['1', '0']
c = S[0]
cnt = 0
for i in range(1, len(S)):
    if c == S[i]:
        c = C[ord(c) - ord('0')]
        cnt += 1
    else:
        c = S[i]
print(cnt)
# Judge status: Wrong Answer
n = int(input())
p = list(map(int, input().split()))
s = 0
for i in range(n - 1):
    if p[i - 1] < p[i] < p[i + 1] or p[i - 1] > p[i] > p[i + 1]:
        s += 1
print(s)
# Judge status: Accepted
s,t = input().split()
a,b = map(int, input().split())
u = input()

if s==u:
    print(a-1, b)
else:
    print(a, b-1)
# Judge status: Accepted
def answer(a: int, b: int, x: int) -> int:
    return b // x - (a - 1) // x


def main():
    a, b, x = map(int, input().split())
    print(answer(a, b, x))


if __name__ == '__main__':
    main()
# Judge status: Accepted
s = str(input())

num = [int(s[-1])]
for i in range(1, len(s)):
    tmp = num[-1] + pow(10, i, 2019) * int(s[-i - 1])
    num.append(tmp % 2019)

mod = [1] + [0] * 2018
ans = 0
for i in num:
    m = i % 2019
    ans += mod[m]
    mod[m] += 1
print(ans)
# Judge status: Accepted
N = int(input())
A1= list(map(int,input().split()))
A2= list(map(int,input().split()))
sum2 = sum(A2)
ans = A1[0]+sum2
value = A1[0]+sum2
for i in range(1,N):
    value = value + A1[i] - A2[i-1]
    ans = max(ans,value)
print(ans)
# Judge status: Accepted
N=int(input())
A=[[0]*9,[0]*9,[0]*9,[0]*9,[0]*9,[0]*9,[0]*9,[0]*9,[0]*9,[0]*9]

for n in range(N+1):
    temp=str(n)
    r=int(temp[-1])
    l=int(temp[0])
    A[r-1][l-1]+=1

ans=0
for i in range(9):
    for j in range(9):
        ans+=A[i][j]*A[j][i]
if N<=9:
    print(N)
else:
    print(ans)
# Judge status: Wrong Answer
def main():
    s1 = input()
    s2 = input()

    s2 = s2[::-1]

    print('Yes' if s1 == s2 else 'No')

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n = int(input())
s = list(input())
a = 0
flag = 0
for i in range(n):
    if flag == 0 and s[i] == "#":
        flag = 1
    
    if flag == 1 and s[i]==".":
        a +=1

b = 0
flag = 0
for i in reversed(range(n)):
    if flag == 0 and s[i]==".":
        flag =1
    
    if flag == 1 and s[i]== "#":
        b +=1
ans = min(a,b)
print(ans)
# Judge status: Accepted
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
#print(a)
lm = [0] * n
rm = [0] * n

for i in range(1, n):
    lm[i] = max(a[i-1], lm[i-1])

for i in range(n-2, -1, -1):
    rm[i] = max(a[i+1], rm[i+1])


for i in range(n):
    print(max(lm[i], rm[i]))
# Judge status: Accepted
s = input()
if len([s.count(i) for i in set(s) if s.count(i) == 2])==2:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
cd = [list(map(int, input().split())) for _ in range(m)]
dist = 10**9


for i, j in ab:
    for o, (p, q) in enumerate(cd):
        dist1 = abs(i - p) + abs(j - q)
        if dist1 < dist:
            dist = dist1
            ch = o + 1
    print(ch)
    dist = 10**9
# Judge status: Accepted
n = list(input())
n = [int(s) for s in n]
N = sum(n)
if N % 9 == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split()))
s = sum(l) - max(l)
if s > max(l): print('Yes')
else: print('No')
# Judge status: Accepted
#Postal Code
A,B=map(int,input().split())
d=["0","1","2","3","4","5","6","7","8","9"]
S=input()
total=0
for i in range(A):
    if S[i] in d:
        pass
    else:
        total=1
S=S[A:]
if S[0]!="-":
    total=1
S=S[1:]
for i in range(B):
    if S[i] in d:
        pass
    else:
        total=1
if total==1:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
print(sum([int(i) for i in list(input())]))
# Judge status: Accepted
n, m = map(int, input().split())
a = list(map(int, input().split()))

print(max(-1, n - sum(a)))
# Judge status: Accepted
S = input()
n = len(S)
S1 = S[0:int((n-1)/2)]
S2 = S[int((n+3)/2-1):n]

if (S[::-1] == S) and (S1[::-1] == S1) and S2[::-1] == S2:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def Input():
    return mapt(int, input().split(" "))


def calc(i, h):
    return all(h[i] >= h[j] for j in range(i))


def main():
    data = [int(input()) for _ in range(5)]
    k = int(input())
    print("Yay!" if k >= data[-1] - data[0] else ":(")


main()
# Judge status: Wrong Answer
q,h,s,d=map(int,input().split())
n=int(input())
h=min(2*q,h)
s=min(2*h,s)
d=min(2*s,d)
ans=0
data=[[2,d],[1,s],[float(0.5),h],[float(0.25),q]]
for i in range(4):
  ans+=(n//data[i][0])*data[i][1]
  n-=(n//data[i][0])*data[i][0]
print(int(ans))
# Judge status: Wrong Answer
X=list(map(int,input().split()))
X.sort
if X==[5,5,7]:
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
N, K = map(int, input().split())
ans = 1
while N % K == 0:
    N = N // K
    ans += 1
print(ans)
# Judge status: Accepted
N,K = map(int,input().split())
x = list(map(int,input().split()))
mi = 10 ** 18
for i in range(N-K+1):
    l = x[i]
    r = x[i+K-1]
    lr = abs(l)+abs(l-r)
    rl = abs(r)+abs(l-r)
    mi = min(mi,min(lr,rl))
print(mi)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
a.sort()
num=a[0]
fin=0
res=[]
i=1
while i<n:
    #print(a[i-1],a[i])
    if a[i-1]==a[i]:
        res.append(a[i])
        i+=2
    else:
        i+=1
#print(res)
if len(res)<2:
    print(0)
else:
    print(res[-1]*res[-2])
# Judge status: Accepted
import math
A,B,N = map(int, input().split())
if N >= B-1:
    x = B-1
else:
    x = N
print(math.floor(A*x/B)-A*math.floor(x/B))
# Judge status: Accepted
N, M = map(int, input().split())
print(min(N+(M-N*2)//4, M//2))
# Judge status: Accepted
def main():
    N, K = map(int, input().split())
    if N % K == 0:
        print(0)
    else:
        print(1)
main()
# Judge status: Accepted
X = int(input())

for i in range(100):
    for j in range(100):
        if i ** 5 + j ** 5 == X:
            print(i, -j)
            exit()
            
        if i ** 5 + j ** 5 > X:
            continue

for i in range(2000):
    for j in range(2000):
        if j ** 5 - i ** 5 == X:
            print(j, i)
            exit()
            
        if j ** 5 - i ** 5 > X:
            continue
# Judge status: Accepted
def main():
    s = input()

    words = ["eraser", "erase", "dreamer", "dream"]

    for word in words:
        s = s.replace(word, "")

    print("YES" if len(s) == 0 else "NO")


if __name__ == "__main__":
    main()
# Judge status: Accepted
import collections
n,k = map(int,input().split())
a = input().split()
a = sorted(list(collections.Counter(a).values()))
print(sum(a[:len(a)-k]))
# Judge status: Wrong Answer
D = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
n = int(input())
S = list(input())

for i in range(len(S)):
    S[i] = D[(D.index(S[i]) + 1) % 26]

print("".join(S))
# Judge status: Accepted
n,m=map(int,input().split())
x=[0 for i in range(n)]
a=[0 for j in range(m)]
ans=0
for i in range(n):
    x[i]=list(map(int,input().split()))
    for j in range(1,x[i][0]+1):
         a[x[i][j]-1]+=1

for s in range(m):
    if n==a[s]:
        ans+=1
print(ans)
# Judge status: Wrong Answer
s,t=input().split()
print (t+s)
# Judge status: Wrong Answer
import math

a, b, h, m = map(int, input().split())
h=h*60+m

ang=abs(h*0.5-m*6)
if ang > 180:
  ang = 360-ang
if ang==180:
  print(a+b)
elif(ang==0):
  print(b-a)
else:
  ans=(a**2)+(b**2)-(2*a*b*math.cos(math.radians(ang)))
  print(math.sqrt(ans))
# Judge status: Accepted
import math
import itertools
num = int(input())
lis = [ i for i in range(1,num+1)]
k = tuple(map(int,input().split()))
t = tuple(map(int,input().split()))
count_k = 0
count_t = 0
count = 0
for i in itertools.permutations(lis):
    count+=1
    if i == k:
        count_k = count
    if i == t:
        count_t = count
    if count_k != 0 and count_t != 0:
        break
print(abs(count_k -count_t))
# Judge status: Wrong Answer
X = int(input())
for i in range(1000):
    if 100*i < X < 105*i:
        print(1)
        exit()
print(0)
# Judge status: Accepted
X, Y, Z = map(int, input().split())
print(X*Y//2)
# Judge status: Accepted
s = input()
n = s.count("N")
ss = s.count("S")
w = s.count("W")
e = s.count("E")
if (n == 0 and ss > 0) or (ss == 0 and n > 0):
  print("No")
  exit()
if (w == 0 and e > 0) or (e == 0 and w > 0):
  print("No")
  exit()
print("Yes")
# Judge status: Wrong Answer
n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]
yx = [[y, x] for x, y in xy]
xy.sort()
yx.sort()
yx = [[x, y] for y, x in yx]

ans = 0
tmp = [xy[0], xy[-1], yx[0], yx[-1]]
print(yx)
for x, y in tmp:
    for x1, y1 in tmp:
        ans = max(ans, abs(x - x1) + abs(y - y1))
print(ans)
# Judge status: Accepted
N = int(input())
L = [int(input()) for _ in range(5)]

n = min(L)
ans = (N+n-1) // n + 4
print(ans)
# Judge status: Wrong Answer
n = int(input())
num = list(map(int,list(str(n))))
ans = 0
fl = False
zc = 0
for i in num:
    zc += 1
    if i >= 6:
        if fl:
            ans += (10-i)
        else:
            ans += (11-i)
            fl = True
    else:
        ans += i
        Fl = False
    if i != 0:
        zc = 0
print(ans-zc)
# Judge status: Accepted

x = int(input())

if x >= 30:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import itertools
n,k=map(int,input().split())
a=list(map(int,input().split()))
pas=[1]
p=1
for i in range(n):
	p=a[p-1]
	pas.append(p)
	if len(pas)!=len(set(pas)):
		nloop=pas.index(p)
		loop=len(pas)-1-nloop
		break
last=(k-nloop)%loop
print(pas[nloop+last])
# Judge status: Wrong Answer
n = int(input())

string = [input().split() for i in range(n)]

li = []
for i in string:
    li.append(int(i[0]) - int(i[1]))

i = 0
c = 0
nli = len(li) - 1

while i != nli:
    if i == 0:
        c += 1
        if c == 3:
            print('Yes')
            exit()
    if i != 0:
        c = 0
    
print('No')
# Judge status: Accepted
a,b=map(int,input().split())
li=[2,3,4,5,6,7,8,9,10,11,12,13,1]
if li.index(a)<li.index(b):
    print("Bob")
elif li.index(a)>li.index(b):
    print("Alice")
else:
    print("Draw")
# Judge status: Wrong Answer
x,y = map(int,input().split())

if x == y:
    print(-1)
else:
    print(x*(y+1))
# Judge status: Wrong Answer
d, t, s = map(int, input().split())
if s/d <= t:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
x=int(input())
y=list(map(int, input().split()))
res=0
for i in range(0,x,2):
  if y[i]%2:
    res+=1
print(res)
# Judge status: Accepted
s = input()

if s[2]==s[3] and s[4]==s[5] : print('Yes')
else : print('No')
# Judge status: Accepted
n = int(input())
*a, = map(int, input().split())

b1 = 0
b2 = 0
b4 = 0
for _a in a:
    if _a%4 == 0:
        b4 += 1
    elif _a%2 == 0:
        b2 += 1
    else:
        b1 += 1

if b2 == 0:
    print("Yes" if b1 <= b4+1 else "No")
else:
    print("Yes" if b1 <= b4 else "No")
# Judge status: Accepted
x = int(input())

ans = [1]
for i in range(2, 1001):
  p = 2
  while i**p <= 1000:
    ans.append(i**p)
    p += 1
while not x in ans:
  x -= 1
print(x)
# Judge status: Accepted
s=input()

blue_count=s.count("1")
red_count=s.count("0")

print(2*min(blue_count, red_count))
# Judge status: Wrong Answer
a,b = map(int,input().split())
t = b-a
print(t*(t-1)//2-b)
# Judge status: Wrong Answer
N = int(input())
s = input()
t = input()
ans = N
if s == t:
    print(ans)
    exit()
if N == 1:
    print(ans*2)
    exit()
ans += 1
for i in range(1, N):
    if s[i:] == t[:-1*i]:
        print(ans)
        exit()
    ans += 1
print(ans*2)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()

def main():
    W, a, b = map(int, input().split())
    if a + W < b:
        print(b - a - W)
    elif a < b + W:
        print(0)
    else:
        print(a - b - W)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
n = int(input())
S = input()
for _ in range(50):
    S_ = S.replace('()', '')
nr = S_.count('(')
nl = S_.count(')')
print('('*nl+S+')'*nr)
# Judge status: Wrong Answer
from sys import stdin
input = stdin.readline

X = int(input())

for i in range(-100, 101):
    for j in range(-100, 101):
        if pow(i, 5) - pow(j, 5) == X:
            print(i, j)
            exit()
# Judge status: Accepted
II = lambda: int(input())
SI = lambda: input()
LI = lambda: list(map(int,input().split()))
MI = lambda: map(int,input().split())
n = II()
d = [[0,0,0] for i in range(n)]
for i in range(n):
	a,b,c = MI()
	if i == 0:
		d[0][0] = a
		d[0][1] = b
		d[0][2] = c
	else:
		d[i][0] = max(d[i-1][1],d[i-1][2])+a
		d[i][1] = max(d[i-1][0],d[i-1][2])+b
		d[i][2] = max(d[i-1][1],d[i-1][0])+c
print(max(d[-1]))
# Judge status: Accepted
n, q = map(int, input().split())
s = input()
l, r = [0]*q, [0]*q
for i in range(q):
    l[i], r[i] = map(int, input().split())

cs = [0]*(n+1)
for i in range(n):
    if i+1 < n and s[i] == 'A' and s[i+1] == 'C':
        cs[i+1] = cs[i] + 1
    else:
        cs[i+1] = cs[i]

for i in range(q):
    print(cs[r[i]-1] - cs[l[i]-1])
# Judge status: Accepted
a,b = map(int,input().split())

import math
ans=0
for i in range(1,1500):
    price8 = math.floor(i*0.08)
    price10 = math.floor(i*0.10)
    if a==price8 and b==price10:
        ans=1
        break
if ans==1:
    print(i)
else:
    print(-1)
# Judge status: Accepted
n = int(input())
if n % 2 == 0:
    print(1 / 2)
else:
    print((n + 1) // 2 / n)
# Judge status: Accepted
coords = [int(input()) for _ in range(5)]
coords.sort()
k = int(input())
if coords[-1] - coords[0] > k:
    print(':(')
else:
    print('Yay!')
# Judge status: Accepted
import sys
input = sys.stdin.readline

# C - When I hit my pocket...
def get_max_biscuits():
	
	if K < A + 1:
		return K + 1
	else:
		count = K - (A+1)
		
		return B + (B-A)*(count//2) + count%2


K, A, B = map(int, input().split())

if B - A >= 2:
	print(get_max_biscuits())
else:
	print(K + 1)
# Judge status: Wrong Answer
#!/usr/bin/python
 
input_data = list(map(int,input().split()))
 
neko = input_data[0]
neko_inu = input_data[1]
d = input_data[2]
 
if neko >= d:
    print("NO")
 
d -= neko
if neko_inu < d:
    print("NO")
    
print("YES")
# Judge status: Accepted

S = input()

if len(S)==3 and S.count('A')==2 or S.count('B')==2:
    print('Yes')

else:
    print('No')
# Judge status: Accepted
N=int(input())
B=[int(i) for i in input().split()]
A_sum = B[0]+B[N-2]
for i in range(1,N-1):
  A_sum=A_sum+ min(B[i-1],B[i])
print(A_sum)
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a==b:
    print("a"*b)
elif a>b:
    print("b"*a)
elif a<b:
    print("a"*b)
# Judge status: Accepted
a,b,c = sorted(map(int,input().split()))
if a+b==c:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
# 解説放送

def main():
    N = int(input())
    *A, = map(int, input().split())

    mis = [0]
    mas = [0]
    for x in reversed(A):
        mis.append((mis[-1] + 1) // 2 + x)
        mas.append(mas[-1] + x)

    if not (mis[-1] <= 1 <= mas[-1]):
        print(-1)
        return

    mas.reverse()

    ans = [1]
    for i, x in enumerate(A, start=1):
        ans.append(min(mas[i], (ans[-1] - x) * 2))

    print(sum(ans))


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N = int(input())
keta = len(str(N))
SN = str(N)
if N <= 9:
    print(N)
elif SN.count('9') == keta:
    print(N)
else:
    print((keta - 1) * 9 + int(SN[0])-1)
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

L, R, d = inm()


def solve():
    r = R // d
    l = (L - 1) // d
    return r - l


print(solve())
# Judge status: Wrong Answer
n = input()

ans = 0
add = 0
c = 0
for i in range(len(n)-1,-1,-1):
    d = int(n[i]) + add
    #print('d:',d)
    if d <= 5:
        ans += d
        add = 0
    else:
        ans += 10-d
        if d == 10:
            c += 1
        if i == 0:
            ans += 1
        else:
            add = 1

print(ans-c)
# Judge status: Wrong Answer
n = int(input())
count=0
for i in range(0,n):
    t,x,y = map(int, input().split())
    if t>=x+y and (x+y-t)%2==0:
        count=count+1
if count==n:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import itertools
import math


def dist(a, b):
    return math.sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2)


N = int(input())
C = [tuple(map(int, input().split())) for _ in range(N)]

s = 0
for cmb in itertools.combinations(C, 2):
    s += 2 * dist(cmb[0], cmb[1]) / N

print(s)
# Judge status: Accepted
n = int(input())
min_s = []
max_s = []
for i in range(n):
    a, b = map(int, input().split())
    min_s.append(a)
    max_s.append(b)

min_s.sort()
max_s.sort()
if n % 2 == 0:
    min_med = (min_s[n // 2 - 1] + min_s[n // 2]) / 2
    max_med = (max_s[n // 2 - 1] + max_s[n // 2]) / 2
    print(int((max_med - min_med) * 2 + 1))

else:
    min_med = min_s[(n + 1) // 2 - 1]
    max_med = max_s[(n + 1) // 2 - 1]
    print(int((max_med - min_med)+1))
# Judge status: Wrong Answer
# 2020/04/28
# CODE FESTIVAL 2017 qual - B

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

# Calc
ans = 'No'
eflg = False
for i in range(n):
    for j in range(m):
        pt = i * (m - j) + j * (n - i)
        if pt == k:
            ans = 'Yes'
            eflg = True
            break
    if eflg:
        break

# Output
print(ans)
# Judge status: Accepted
K = int(input())
if K % 2 == 0:
  print((K//2)**2)
else:
  a = (K-1) // 2
  b = a + 1
  print(a*b)
# Judge status: Accepted
M=2019;l,r=map(int,input().split())
print(0 if r//M-l//M>0 else min(i*j%M for i in range(l,r) for j in range(i+1,r+1)))
# Judge status: Accepted
N = int(input())

if N%2:
    ans = 0
else:
    ans = 0
    d = 10
    while d <= N:
        ans += N//d
        d *= 5

print(ans)