Harryxun/stf_run huggingface dataset:
S = input()

def judge(x):
  if "".join(list(reversed(x))) == x:
    return True
  else:
    return False
  
def solve(x):
  if judge(x) and judge(x[0:(len(x)-1)/2]) and judge(x[(len(x)+1)/2:]):
    print("Yes")
  else:
    print("No")
    
    
solve(S)

### FIXED CODE ###

S = input()

def judge(x):
  if "".join(list(reversed(x))) == x:
    return True
  else:
    return False
  
def solve(x):
  if judge(x) and judge(x[0:int((len(x)-1)/2)]) and judge(x[int((len(x)+1)/2):]):
    print("Yes")
  else:
    print("No")
    
    
solve(S)
a,b,c = map( int , raw_input().split() )
n = 0

for i in range( a , b+1 ):
  if c % i == 0
    n = n + 1
print n

### FIXED CODE ###

a,b,c = map( int , raw_input().split() )
n = 0

for i in range( a , b+1 ):
  if c % i == 0:
    n = n + 1
print n
s = input()
t = input()
 
count = 0
 
for i in range(3):
	if s[i] == t[i]
	count += 1  
  	print(count)

### FIXED CODE ###

s = input()
t = input()
 
count = 0
 
for i in range(3):
		if s[i] == t[i]:
			count += 1  
    
print(count)
def floor(t):
    return int(t)


def fs(A, B, x):
    return floor(A*x/B) - (A * floor(x/B))

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

    ans = 0

    low = 1
    if N % 2 == 0:
        high = N
    else:
        high = N + 1

    while abs(low - high) != 1:
        mid = (high + low) // 2
        tmp = fs(A, B, mid)
        if tmp > ans:
            ans = tmp
            low = mid
        else:
            high = mid

    print(tmp)


    return 0

if __name__ == '__main__':
    main()

### FIXED CODE ###

import math
def fs(A, B, x):
    return math.floor(A*x/B) - A * math.floor(x/B)


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

    print(fs(A, B, min(N, B-1)))
    return 0

if __name__ == '__main__':
    main()
n = int(input())
l = list(map(int,input().split()))
ans = 0
for i in range(n):
    if i+1 == l[i]:
        a = l[i]
        b = l[i+1]
        l[i]=b
        l[i+1]=a
        ans += 1
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(n):
    if i+1 == a[i] and i != n-1:
        b = a[i]
        c = a[i+1]
        a[i] = c
        a[i+1] = b
        ans += 1
    elif i+1 == a[i]:
        ans += 1
print(ans)
k = int(input)
a,b = map(int, input().sprit())
ans = False
for i in range(a,b+1) :
  if i%k == 0 : 
    ans = True
    break
    
if ans : print('OK')
else print('NG')
    

### FIXED CODE ###

k = int(input())
a,b = map(int,input().split())
ans = 'NG'
for i in range(a,b+1) :
  if i%k == 0 : 
    ans = 'OK'

print(ans)
D, G = map(int, input().split())
PC = [list(map(int,input().split())) for i in range(D)]

l = []
for i in range(2 ** D):
  t = 0
  c = 0
  for j in range(D):
    if ((i >> j) & 1):
      t += (j+1)*100*PC[j][0]+PC[j][1]
      c += PC[j][0]
  if t >= G:
    l.append(c)
  else:
    ck = []
    for j in range(D):
      if ((i >> j) & 0):
        ck.append(j)
    while t < G:
      t += (max(ck)+1)*100
      c += 1
    l.append(c)
      
print(min(l))


### FIXED CODE ###

D, G = map(int, input().split())
PC = [list(map(int,input().split())) for i in range(D)]

l = []
for i in range(2 ** D):
  t = 0
  c = 0
  for j in range(D):
    if ((i >> j) & 1):
      t += (j+1)*100*PC[j][0]+PC[j][1]
      c += PC[j][0]
  if t >= G:
    l.append(c)
  else:
    ck = []
    for j in range(D):
      if ((i >> j) & 1):
        continue
      else:
        ck.append(j)
    if ck == []:
      continue
    ckm = max(ck)
    for k in range(PC[ckm][0]):
      t += (ckm+1)*100
      c += 1
      if t >= G:
        l.append(c)
        break
      
print(min(l))
import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
N,M=map(int,input().split())
if N==0:
  a=0
else:
  a = comb(N,2)
if M==0:
  b=0
else:
  b = comb(M,2)
print(a+b)

### FIXED CODE ###

N,M=map(int,input().split())
print((N*(N-1)+M*(M-1))//2)
import math

A, B = map(int, input().split())
print(A * B // math.gcd(A, B))


### FIXED CODE ###

import fractions

A, B = map(int, input().split())
print(A * B // fractions.gcd(A, B))
N = int(input())
H = list(map(int, input().split()))
ans = 'Yes'
if N == 1:
  print(ans)
else:
  for i in range(N):
    if i == 0:
      if H[0]-1 > H[1]:
        ans = 'NO'
        break
      elif H[0] > H[1]:
        H[0] -= 1
    else:
      if H[i] <= H[i+1]:
        continue
      elif H[i]-1 > H[i+1]:
        ans = 'No'
        break
      elif H[i] > H[i+1]:
        if H[i-1] == H[i]:
          ans = 'No'
          break
        else:
          H[i] -= 1
  print(ans)

### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
ans = 'Yes'
if N == 1:
  print(ans)
else:
  for i in range(N-1):
    if i == 0:
      if H[0]-1 > H[1]:
        ans = 'No'
        break
      elif H[0]-1 == H[1]:
        H[0] -= 1
        continue
    else:
      if H[i] <= H[i+1]:
        if H[i-1]<=H[i]-1:
          H[i] -=1
        continue
      elif H[i]-1 > H[i+1]:
        ans = 'No'
        break
      elif H[i]-1 == H[i+1]:
        if H[i-1] == H[i]:
          ans = 'No'
          break
        else:
          H[i] -= 1
  print(ans)
N = int(input())
xyh = [list(map(int, input().split())) for _ in range(N)]

for Cx in range(101):
    for Cy in range(101):
        for i in range(N):
            if xyh[i][2] >= 1:
                H = xyh[0][2] + abs(Cx-xyh[0][0]) + abs(Cy-xyh[0][1])
                break
        for i in range(N):
            if xyh[i][2] != max(H-abs(xyh[i][0]-Cx)-abs(xyh[i][1]-Cy), 0):
                break
        else:
            res = [str(Cx), str(Cy), str(H)]

print(" ".join(res))

### FIXED CODE ###

N = int(input())
x = []
y = []
h = []
for i in range(N):
    a, b, c = map(int, input().split())
    x.append(a)
    y.append(b)
    h.append(c)
    if c >= 1:
        xt = a
        yt = b
        ht = c

for Cx in range(101):
    for Cy in range(101):
        H = max(ht + abs(Cx - xt) + abs(Cy - yt), 0)
        for i in range(N):
            Z = max(H - abs(Cx - x[i]) - abs(Cy - y[i]), 0)
            if h[i] != Z:
                break
        else:
            res = [str(Cx), str(Cy), str(H)]

print(" ".join(res))
n, a, b = map(int, input().split())
if (n == 1 and a == b):
  ans = 1
elif (n == 1):
  ans = 0
elif A > B:
  ans = 0
else:
  ans = (b - a) * (n - 2) + 1
print(ans)

### FIXED CODE ###

n, a, b = map(int, input().split())
if (n == 1 and a == b):
  ans = 1
elif (n == 1):
  ans = 0
elif a > b:
  ans = 0
else:
  ans = (b - a) * (n - 2) + 1
print(ans)
# -*- coding: utf-8 -*-
import math

if __name__ == '__main__':
    N = int(input())
    T = []
    for i in range(N):
        T.append(int(input()))

    a = T[0]
    for i in range(1,len(T)):
        A = int(math.gcd(int(a), int(T[i])))
        a = a * T[i] / A

    print(int(a))


### FIXED CODE ###

import fractions
N = int(input())
T = list(int(input()) for _ in range(N))
ans = T[0]
for i in range(1, N):
    ans = ans * T[i] // fractions.gcd(ans, T[i])
print(ans)
n=int(input())
arr=list(map(int,input().split()))
t=1
for i in range(n):
  if arr[i]==0:
    t=0
    break
   elif t>10**18:
    t=-1
    break
  t*=arr[i]
  
print(t)
 

### FIXED CODE ###

n=int(input())
arr=list(map(int,input().split()))
t=1
arr.sort()
for i in range(n):
    t*=arr[i]
    if arr[i]==0:
        t=0
        break
    elif t>10**18:
        t=-1
        break
print(t)
a,b,c,d=map(int,input().split())
zen=int(b-a)
c=int(zen//c)
d=int(zen//d)
kasa=int(zen/(c*d))

ans=zen-c-d+kasa

print(ans)

### FIXED CODE ###

import math
a,b,c,d=map(int,input().split())
count=b-a+1

A=a-1
l=c*d//math.gcd(c,d)
acou=(A//c)+(A//d)-int((A//l))
bcou=(b//c)+(b//d)-int((b//l))

print(count-(bcou-acou))
from collections import deque

_l = deque(input().split(' '))

last = _l.pop()

second = _l.pop()
d = _l.pop()
c = _l.pop()

first = _l.pop()
b = _l.pop()
a = _l.pop()

print(eval("({}{}{}){}({}{}{})".format(a, first, b, last, c, second, d)))

### FIXED CODE ###

import re

stack = []
_l = input().split(' ')

for c in _l:
    if re.match(r"(\+|\-|\/|\*)", c):
        f = stack.pop()
        z = stack.pop()
        stack.append(eval("{}{}{}".format(z, c, f)))
    else:
        stack += [c]

print(stack[0])
from collections import Counter

S=input()
T=input()

S=Counter(S).values()
T=Counter(T).values()

S.sort()
T.sort()

if S==T:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

from collections import Counter

S=input()
T=input()

S=list(Counter(S).values())
T=list(Counter(T).values())

S.sort()
T.sort()

if S==T:
  print('Yes')
else:
    print('No')
a,b,c=map(int, input().split())
if((a+b+c)%3=0):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a,b,c=map(int, input().split())
if(a+b==c)or(b+c==a)or(a+c==b):
    print("Yes")
else:
    print("No")
s=input()
k=input();k=int(k)
l=min(len(s),k)
for i in range(l+1):
  if s[i] == "1":
    tmp=1
  else:
    tmp=int(s[i])
    break
print(tmp)
  

### FIXED CODE ###

s=input()
k=int(input())

for i in s:
  if i == "1":
    k-=1
  else:
    print(i)
    exit()
  if k == 0:
    print(i)
    exit()
if __name__=="__main__":
    import sys
    a = int(input("Please enter a nubmer: "))
    s = input("Please enter a String: ")
 else:
     a = input()
     s = input()
if a>=3200:
 print(s)
else:
 print('red')


### FIXED CODE ###

if __name__=="__main__":
    import sys
    a = int(input())
    s = input()

if a>=3200:
    print(s)
else:
    print('red')
a=int(input()
b=int(input()
c=int(input()
d=int(input()
e=int(input()
x=int(input()
ls=[a,b,c,d,e]
ls.sort()
if ls[1]-ls[0]<=x and ls[2]-ls[1]<=x and ls[3]-ls[2]<=x and ls[4]-ls[3]<=x:
  print("Yay!")
else:
  print(":(")

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
x=int(input())
ls=[a,b,c,d,e]
if (e-a)<=x:
  print("Yay!")
else:
  print(":(")
a, b = input().split()

a[3] = 8
print(a+b)

### FIXED CODE ###

s = input()

print("2018/01/" + s[-2:])
n=int(input())
print(ceil(n/2))

### FIXED CODE ###

from math import ceil, floor

n = int(input())
print(ceil(n/2))
a, b = map(int,input().split())
print(int(a*b))

### FIXED CODE ###

a, b = input().split()
a = int(a)

for i in range(len(b)):
    if b[i] == '.':
        t = 10 ** (len(b)-1-i)
        nb = int(b[:i] + b[i+1:])

print(a*nb//t)
a = int(input())
return (a ** 3)

### FIXED CODE ###

x = int(input())
print (x ** 3)
A, B = map(input().split())

if A % 2 == 1 and B % 2 == 1:
    print("Yes")

else:
    print("No")

### FIXED CODE ###

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

if A % 2 == 1 and B % 2 == 1:
    print("Yes")

else:
    print("No")
x = input()
y = input()
z = input()

print x[0]+y[0]+z[0]

### FIXED CODE ###

x, y, z = input().split()

print (x[0]+y[0]+z[0])
def solve():
    N, M = map(int, input().split())
    T = {}
    for i in range(M):
        a, b = map(int, input().split())
        if a not in T:
            T[a] = []
        T[a].append(b)
        if b not in T:
            T[b] = []
        T[b].append(a)
    # print(N, M, T)
    FROM_1 = set(T[1])
    TO_N = set(T[N])
    ans = FROM_1 & TO_N
    print('POSSIBLE') if ans else print('IMPOSSIBLE')

if __name__ == '__main__':
    solve()


### FIXED CODE ###

N, M = map(int, input().split())
T = {}
for i in range(M):
    a, b = map(int, input().split())
    if a not in T:
        T[a] = []
    T[a].append(b)
    if b not in T:
        T[b] = []
    T[b].append(a)
# print(N, M, T)
FROM_1 = T[1]

for f in FROM_1:
    if N in T[f]:
        print('POSSIBLE')
        exit()
print('IMPOSSIBLE')
def gcd_e(x, y):
  if y == 0:
    return x
  else:
    return gcd_e(y,x%y)      

def lcm(x, y):
  return (x * y) // gcd_e(x, y)

n,m=list(map(int,input().split()))
A=list(map(int,input().split()))
a,b=A[0],0

for i in range(1,n):
  b = A[i]
  a = lcm(a,b)
  
if a / 2 > m:
  print('0')
else:
  print((m-a//2)//a+1)

### FIXED CODE ###

def gcd_e(x, y):
  if y == 0:
    return x
  else:
    return gcd_e(y,x%y)      

def lcm(x, y):
  return (x * y) // gcd_e(x, y)

n,m=list(map(int,input().split()))
A=list(map(int,input().split()))
a,b=A[0],0

for i in range(1,n):
  b = A[i]
  a = lcm(a,b)
  
for i in range(n):
  if (a // A[i]) % 2 == 0:
    print('0')
    exit()    
  
if a // 2 > m:
  print('0')
else:
  print((m-a//2)//a+1)
def edit_distance(a):
 n = len(a)
 A = [[0 for i in range(n)] for j in range(n)]
 for long in range(2, n+1):
  for i in range(0, n-long+1):
   k = i+long-1
   def f(i,j,k):
    return A[i][j-1]+A[j][k]+M[i][0]*M[j-1][1]*M[k][1]
   A[i][k] = min([f(i,j,k) for j in range(i+1,k+1)])
 return A[0][n-1]
n = input()
M = []
for i in range(n):
 M.append(map(int, raw_input().split()))
print edit_distace(M)

### FIXED CODE ###

def edit_distance(M):
  n = len(M)



  m = [[0 for i in range(n)] for j in range(n)]
   
  for long in range(2, n+1):

    for i in range(0, n-long+1):

      j = i + long - 1

      def a(i, k ,j):
        return m[i][k] + m[k+1][j] + M[i][0]*M[k][1]*M[j][1]
      m[i][j] = min(a(i, k, j) for k in range(i, j))
   
  return m[0][n-1]
 
n = input()
M = []
 
for i in range(n):
  M.append(map(int, raw_input().split()))
print edit_distance(M)
a, b, c = (int(i) for i in input().split())

if a * c ＜ b:
    print(c)
else:
    print(b//a)

### FIXED CODE ###

a, b, c = (int(i) for i in input().split())

if ((a * c) < b):
    print(c)
else:
    print(b//a)
import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    X, N = LI()
    if N == 0:
        print(X)
        return

    p = LI()

    p_max = max(p)
    p_min = min(p)

    if X < p_min or p_max < X:
        print(X)
        return
    else:
        d = [abs(i-X) for i in range(1, 101) if i not in p]
        d_min = min(d)
        for i in range(1, 101):
            if i not in p:
                if abs(i-X)==d_min:
                    print(i)
                    return

if __name__ == '__main__':
    resolve()


### FIXED CODE ###

import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    X, N = LI()
    if N == 0:
        print(X)
        return

    p = LI()

    p_max = max(p)
    p_min = min(p)

    if X < p_min or p_max < X:
        print(X)
        return
    else:
        d = [abs(i-X) for i in range(0, 102) if i not in p]
        d_min = min(d)
        for i in range(0, 102):
            if i not in p:
                if abs(i-X)==d_min:
                    print(i)
                    return

if __name__ == '__main__':
    resolve()
n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = 10**9 + 7
ans = 1

if k == 1:
    print(max(a))
    exit()

lst = []
minus = []
for i in range(n):
    if a[i] >= 0:
        lst.append([a[i], 1])
    else:
        minus.append(a[i])

if k % 2 == 1 and lst != []:
    lst.sort(key=lambda x: x[0])
    ans *= lst.pop()[0]
    k -= 1
elif k % 2 == 1 and lst == []:
    a.sort(reverse=True)
    for i in range(k):
        ans *= a[i]
        ans %= mod
    print(ans)
    exit()

minus.sort(reverse=True)
while minus != []:
    if len(minus) >= 2:
        a = minus.pop()
        b = minus.pop()
        lst.append([a*b, 2])
    else:
        a = minus.pop()
        lst.append([a, 1])

lst.sort(key=lambda x: x[0])
while k > 0:
    lst1 = lst.pop()
    lst2 = lst.pop()
    if [lst1[1], lst2[1]] == [1, 1]:
        ans *= lst1[0]
        ans %= mod
        ans *= lst2[0]
        ans %= mod
    elif [lst1[1], lst2[1]] == [1, 2]:
        ans *= lst2[0]
        ans %= mod
        lst.append(lst1)
    elif [lst1[1], lst2[1]] == [2, 1]:
        ans *= lst1[0]
        ans %= mod
        lst.append(lst2)
    else:
        ans *= lst1[0]
        ans %= mod
        lst.append(lst2)
    k -= 2
print(ans)

### FIXED CODE ###

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

if k == n:
    for i in range(n):
        ans *= a[i]
        ans %= mod
    print(ans)
    exit()
if max(a) < 0 and k%2 == 1:
    a.sort(reverse=True)
    for i in range(k):
        ans *= a[i]
        ans %= mod
    print(ans)
    exit()

a.sort(key=lambda x: abs(x))
cnt = 0
for i in range(1, k+1):
    ans *= a[-i]
    ans %= mod
    if a[-i] < 0:
        cnt += 1

if cnt%2 == 0:
    print(ans)
else:
    a_plus = None
    a_minus = None
    b_plus = None
    b_minus = None
    for i in range(k, 0, -1):
        if a[-i] >= 0 and a_plus == None:
            a_plus = a[-i]
        if a[-i] < 0 and a_minus == None:
            a_minus = a[-i]
    for i in range(k+1, n+1):
        if a[-i] >= 0 and b_plus == None:
            b_plus = a[-i]
        if a[-i] < 0 and b_minus == None:
            b_minus = a[-i]
    if a_plus == None or b_minus == None:
        ans *= pow(a_minus, mod-2, mod)
        ans %= mod
        ans *= b_plus
        ans %= mod
    elif a_minus == None or b_plus == None:
        ans *= pow(a_plus, mod-2, mod)
        ans %= mod
        ans *= b_minus
        ans %= mod
    else:
        if abs(a_plus*b_plus) > abs(a_minus*b_minus):
            ans *= pow(a_minus, mod-2, mod)
            ans %= mod
            ans *= b_plus
            ans %= mod
        else:
            ans *= pow(a_plus, mod-2, mod)
            ans %= mod
            ans *= b_minus
            ans %= mod
    print(ans)
N,K,S=map(int,input().split())


base=[]

for i in range(N-K):
    base.append(S//(N-K+1))
base.append(S-(N-K)*S//(N-K+1))

for j in range(K-1):
    base.append(base[i%(N-K+1)-1])



print(" ".join(map(str,base)))
    


### FIXED CODE ###

N,K,S=map(int,input().split())
a=(S+1)%pow(10,9)

answer=[S]*K+[a]*(N-K)

print(" ".join(map(str,answer)))
from functools import reduce
from operator import mul

mod = 10**9 + 7

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

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

if N == K:
    print(reduce(mul, A)%mod)

else:

    AP = []
    AM = []
    for i in A:
        if i < 0:
            AM.append(i)
        else:
            AP.append(i)
            
    if len(AP) == 0 and K%2 != 0:
        AM.sort(reverse=True)
        AM = AM[:K]
        print(reduce(mul, AM)%mod)

    else:
        
        AP.sort(reverse=True)
        AM.sort()

        ans = 1
        p = 0
        m = 0
        cnt = 0
        while True:
            if (K - cnt) == 1:
                ans *= AP[p]
                print(ans%mod)
                break
                
            if p+1 <= len(AP) and AP[p]*AP[p+1] >= AM[m]*AM[m+1]:
                ans *= (AP[p]*AP[p+1])
                p += 2
                cnt += 2
                
            if m+1 <= len(AM):
                ans *= (AM[m]*AM[m+1])
                m += 2
                cnt += 2 

            if cnt == K:
                print(ans%mod)
                break

### FIXED CODE ###

from bisect import bisect_left,bisect_right
p=10**9+7
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
pi=1
ni=0
ans=1
i=0
while i<k-1:
  if a[ni]*a[ni+1]>a[-pi]*a[-pi-1]:
    ans=ans*a[ni]*a[ni+1]%p
    ni+=2
    i+=2
  else:
    ans=ans*a[-pi]%p
    pi+=1
    i+=1
if i==k-1:
  ans=ans*a[-pi]%p
if a[-1]<0 and k%2==1:
  ans=1
  for i in a[n-k:]:
    ans=ans*i%p
print(ans)
n,m=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
c=0
for i in range(n+1):
    c+=x[i]
print(c)

### FIXED CODE ###

n,m=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
c=0
l=[]
for i in range(m-1):
    l.append(abs(x[i]-x[i+1]))
l.sort()
if len(l)-n+1<=0:
    print("0")
else:
    for i in range(len(l)-n+1):
        c+=l[i]
    print(c)
N,K = map(int,input().split())
stones = list(map(int,input().split()))
dp =[0] *N

for i in range(1,N):
    dp[i] = min(abs(stones[i] - stones[j]) + dp[j] for j in range(max(0, i - K), i))

print(dp[-1])


### FIXED CODE ###

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

dp = [0]*n
dp[1] = abs(cost[0] - cost[1])

for i in range(2,n):
    dp[i] = min(dp[i-2] + abs(cost[i] - cost[i-2]), dp[i-1] + abs(cost[i] - cost[i-1]))

print(dp[n-1])
def digitSum(n):
    # 数値を文字列に変換
    s = str(n)
    # １文字ずつ数値化し配列にする。
    array = list(map(int, s))
    # 合計値を返す
    return sum(array)
S = input()
Scount = 0
for i in range(len(S)):
    for j in range(1,len(S)):
        if (i+j)<len(S):
            part_S = S[i:i+j]
            num = int(part_S)
            if num % 673 == 0:
                num = int(num/673)
                sum3 = digitSum(num)
                while sum3 != digitSum(sum3):
                    sum3 = digitSum(sum3)
                if sum3 == 3 or sum3 == 6 or sum3 ==9:
                    Scount += 1
print(Scount)

### FIXED CODE ###

S = input()
from collections import defaultdict
d = defaultdict(int)
before = 0
for i in range(1,len(S)+1):
    now = (int(S[-i])*pow(10,i,2019)+before) % 2019
    d[now] += 1
    before = now
d[0] += 1
ans = 0
for i in d.values():
    ans += i*(i-1)//2
print(ans)
def main():
    W, H, x, y, r = [int(i) for i in input().split()]
    if x-r >= 0 and x+r <= w and  y-r >= 0,and y+r <= H :
        print("Yes")
    else :
        print("No")
    if __name__ == '__main__' :
        main()

### FIXED CODE ###

def main() :
    W, H, x, y, r = [int(i) for i in input().split()]

    if ((x-r)>=0) and ((x+r)<=W) and ((y-r)>=0) and ((y+r)<=H) :
        print("Yes")
    else :
        print("No")

if __name__ == '__main__' :
    main()
n = int(input())
arr = list(int,input().split())
def mod(i): return i%2==1
lst = list(filter(mod,arr[::2]))
print(len(lst))

### FIXED CODE ###

n = int(input())
arr = list(map(int,input().split()))
def odd(n) : return (n%2==1)
lst = list(filter(odd,arr[0:n:2]))
print(len(lst))
I = input().split()

K = int(I[0])
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]
print( A[K] )


### FIXED CODE ###

I = input().split()
         
K = int(I[0])
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]
print( A[K-1] )
s = input()
S = list(s)

ans = 0
if len(S) == 1:
    print(ans)
    exit()
for i in range(1,len(S)):
    if S[i] is S[i-1]:
        if S[i] is '0':
            S[i] = '1'
        else:
            S[i] = '0'
        print(S)
        ans += 1
print(ans)

### FIXED CODE ###

s = input()
S = list(s)

ans = 0
if len(S) == 1:
    print(ans)
    exit()
for i in range(1,len(S)):
    if S[i] is S[i-1]:
        if S[i] is '0':
            S[i] = '1'
        else:
            S[i] = '0'
        ans += 1
print(ans)
n=int(input())
n=input().split()
for i in range(len(n)):
   n[1]=int(n[i])
   s=sum(n)
   m=min(n)
   ma=max(n)
   print(m ma s)


### FIXED CODE ###

n=int(input())
r=input().split()
for i in range(len(r)):
    r[i]=int(r[i])
s=sum(r)
m=min(r)
ma=max(r)
print(m,ma,s)
import numpy as np
N=int(input())
a=np.array(list(map(int,input().split())))

def f(m):
    ret=0
    for i in a:
        ret+=m%i
    return ret
  
def gcd_(a,b):
    if a<b:    a,b=b,a
    if b==0:    return a
    return gcd_(b,a%b)

def lcm_(x,y):
    return (x*y)//gcd_(x,y)

def lcm(l):
    ans=l[0]
    for i in l:
        ans=lcm_(ans,i)
    return ans
  
print(f(lcm(a)-1))

### FIXED CODE ###

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

def f(m):
    ret=0
    for i in a:
        ret+=m%i
    return ret
  
print(f(-1))