peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
S=input()

if(S[0]==[1] or S[1]==S[2] or S[2]==S[3]):
    print("Bad")
else:
    print("Good")
# Judge status: Accepted
import math

a, b = input().split()
s = a + b
i = int(s)
r = math.sqrt(i)
if r.is_integer():
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s = input()
A = [0] * (len(s) + 1)
for i, c in enumerate(s):
	if c == '<':
		A[i+1] = A[i] + 1
for i, c in enumerate(s[::-1]):
	if c == '>':
		x = len(s) - i
		A[x-1] = max(A[x-1], A[x] + 1)
print(sum(A))
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a%b==1:
  print(1)
else:
  print(0)
# Judge status: Accepted
N, K = map(int, input().split())
hs = [int(input()) for i in range(N)]
hs.sort()

m = hs[K-1] - hs[0]
for i in range(1,N-K+1):
    m = min(m, hs[i + K - 1] - hs[i])
print(m)
# Judge status: Accepted
# C - Five Transportations / 

n = int(input())
t = []
for i in range(5):
    t.append(int(input()))

m = min(t)
print((n+m-1)//m - 1 + 5 )
# Judge status: Accepted
a = int(input())
b = int(input())
h = int(input())
area = h * min(a, b) + h * abs(b - a) * 0.5
print(int(area))
# Judge status: Accepted
s = input()
t = input()
ans = 0
for i in range(len(s)):
  ans += 1 if s[i] != t[i] else 0
print(ans)
# Judge status: Wrong Answer
n = int(input())
p = input().split()
P = sorted(p)
length = len(p)
count = 0
for i in range(0, length):
  if p[i] != P[i]:
    count += 1
if count >= 3:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
N = int(input())
W = [input() for _ in range(N)]

def puts(s): # 個人的にこのほうが解りやすいので。。。
    print(s)

ans = 'Yes'

for i in range(N - 1):
    if W[i][-1] != W[i + 1][0]:
        ans = 'No'
        break

W.sort()

for i in range(N - 1):
    if W[i] == W[i + 1]:
        ans = 'No'
        break

puts(ans)
# Judge status: Accepted
n = int(input())
buttons = []
for _ in range(n):
    buttons.append(int(input()))

light = buttons[0]
for i in range(n):
    if light == 2:
        print(i+1)
        break
    light = buttons[light-1]
else:
    print(-1)
# Judge status: Accepted
def main():
	N, C, K = map(int, input().split())
	
	T = [int(input()) for _ in range(N)]
	T = sorted(T)

	num_bus = 1
	num_passenger = 1
	first_passenger = T[0]

	for i in range(1, N):
		if first_passenger + K < T[i]:
			first_passenger = T[i]
			num_passenger = 1
			num_bus += 1
		elif num_passenger == C:
			first_passenger = T[i]
			num_passenger = 1
			num_bus += 1
		else:
			num_passenger += 1

	print(num_bus)
		

 
if __name__ == "__main__":
  	main()
# Judge status: Accepted
N,K = map(int,input().split())
A = list(map(int,input().split()))

x = K
ans = 1
while x < N:
    x += K-1
    ans += 1
print(ans)
# Judge status: Accepted
s = input()
z = s.count("0")
o = s.count("1")

print(min(z, o)*2)
# Judge status: Accepted
S = input()
i = 0
n = len(S)
while i <= n-5:
    if S[i:i+5] == "dream":
        i += 5
        if S[i:i+2] == "er" and S[i:i+5] != "erase":
            i += 2
    elif S[i:i+5] == "erase":
        i += 5
        if S[i:i+1] == "r":
            i += 1
    else:
        break
if i != len(S):
    print("NO")
else:
    print("YES")
# Judge status: Accepted
n=int(input())
k=int(input())
x=int(input())
y=int(input())
if n>=k:
  print(k*x+(n-k)*y)
else:
  print(n*x)
# Judge status: Accepted
n, k = list(map(int, input().split()))


l = set()
d = [input().split() for _ in range(k*2)]
for i in range(len(d)):
	if i % 2 == 1:
		l = l | set(d[i])
print(n - len(l))
# Judge status: Accepted
x,y = map(int, input().split())
b = (y/2-x)
a = x - b
if 2*a+4*b != y or y%2 or x*2 > y or x*4 < y:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
N=int(input())
h=list(map(int, input().split()))
cnt=0
ans=0
 
for i in range(N-1):
    if h[i]>=h[i+1]:
        cnt+=1
    else:
        cnt=0
    
    if cnt>ans:
        ans=cnt
 
print(ans)
# Judge status: Accepted
import fractions
from functools import reduce
 
def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

n = int(input())
a = list(map(int,input().split()))
 
print(gcd(*a))
# Judge status: Accepted
N, M = list(map(int, input().split()))
if N > M:
    N, M = M, N
res = 0
if M == 1:
    res = 1
elif N == 2 or M == 2:
    res = 0
elif N == 1:
    res = M - 2
else:
    res = (N - 2) * (M - 2)
print(res)
# Judge status: Accepted
K = int(input())

c = 0

a = 7 % K
for i in range(K + 1):
    if a == 0:
        print(i + 1)
        exit()
    a = (a * 10 + 7) % K

print(-1)
# Judge status: Accepted
n=int(input())
L=[0 for _ in range(n+1)]
for i in range(n):
    L[i]=int(input())
list.sort(L, reverse=True)
ans=0
cnt=1
for i in range(n):
    if L[i]==L[i+1]:
        cnt+=1
    else:
        if cnt%2!=0:
            ans+=1
        cnt=1
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
sc = [list(map(int, input().split())) for _ in range(m)]

if n == 1:
    num_list = list(range(10))
else:
    num_list = list(range(10**(n-1), 10**n))
        
for i in num_list:
    flg = True
    for s, c in sc:
        if str(i)[s-1] != str(c):
            flg = False
            break
    if flg:
        print(i)
        exit()
print(-1)
# Judge status: Accepted
import string
al = string.ascii_lowercase

S = input()
ans = "yes"
for a in al:
  if S.count(a) > 1:
    ans = "no"
print(ans)
# Judge status: Wrong Answer
nd=input().split()
n=int(nd[0])
d=int(nd[1])
L=[]
for i in range(0,n):
	xy=input().split()
	x=int(xy[0])
	y=int(xy[1])
	L.append((x,y))
L.sort()
z=d*d
a=(L[0][0])**2+(L[0][1])**2
if(a<=z):
	count=1
else:
	count=0
for i in range(1,n):
	if(L[i]!=L[i-1]) and ((L[i][0])**2+(L[i][1])**2<=z):
		count+=1
print(count)
# Judge status: Accepted
S = input()
T = input()

print(sum(a!=b for a,b in zip(S,T)))
# Judge status: Wrong Answer
N = list(input())

N[3] = "7"
date = ''.join(N)
print(date)
# Judge status: Accepted
import math
a,b=map(int,input().split())
print(1+math.ceil((b-a)/(a-1)))
# Judge status: Accepted
N = int(input())
*A, = map(int, input().split())
ans = 1
mx = 10**18
for a in A:
    if a == 0:
        print(0)
        exit()
for a in A:
    ans *= a
    if ans > mx:
        print(-1)
        exit()
print(ans)
# Judge status: Accepted
print("YES" if input() in "357" else "NO")
# Judge status: Wrong Answer
s = input()
l = ''
n = int(input())
alp = [chr(ord('a')+i) for i in range(26)]
for i in range(len(s)):
  if i != len(s)-1:
    if 97+26-ord(s[i]) <= n:
      n -= (123-ord(s[i]))
      l += 'a'
    else:
      l += s[i]
  else:
    t = ord(s[i])
    if t+n <= 122:
      l += chr(t+n)
    else:
      n = n%26
      if t+n <= 122:
        l += chr(t+n)
      else:
        l += chr(t+n-26)
print(l)
# Judge status: Accepted
from fractions import gcd
A, B = map(int, input().split())
g = gcd(A, B)
ans = 1
n = 2
while g > 1:
  if n * n > g:
    ans += 1
    break
  if g % n == 0:
    ans += 1
  while g % n == 0:
    g //= n
  n += 1
print(ans)
# Judge status: Accepted
# 150 A

k, x = map(int, input().split())

sum = k * 500
if sum >= x:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n, d = map(int, input().split())
xy = [list(map(int, input().split())) for _ in range(n)]

cnt = 0
for i in range(n):
    if xy[i][0] ** 2 + xy[i][1] ** 2 <= d ** 2:
        cnt += 1
print(cnt)
# Judge status: Accepted
n = int(input())
now = 1
L = []
while now*(now-1)//2 < n:
  L.append(now)
  now += 1
c = sum(L)
if c > n:
  L.remove(c-n)
print(*L, sep="\n")
# Judge status: Accepted
s =list(map(int, list(input())))
INF = 1001001001001
dp1=[INF]*1001001
dp2=[INF]*1001001
n=len(s)
dp1[n-1]=s[n-1]
dp2[n-1]=10-s[n-1]
for i in reversed(range(n-1)):
    if s[i]<9:
        dp1[i] = min(dp1[i+1]+s[i],dp2[i+1]+s[i]+1)
    else:
        dp1[i] = dp1[i+1]+s[i]
    dp2[i] = min(dp1[i+1]+10-s[i], dp2[i+1]+10-s[i]-1)

dp2[0]+=1
print(min(dp1[0], dp2[0]))
# Judge status: Accepted
A, B = list(map(int, input().split()))
ans = 0
for _ in range(2):
	ans += max(A, B)
	if A > B:
		A -= 1
	else:
		B -= 1
print(ans)
# Judge status: Wrong Answer
N = int(input())
CSF = [list(map(int, input().split())) for _ in range(N - 1)]


for i in range(N):
    t = 0

    for c, s, f in CSF[i:]:
        # 待ち時間
        if t < s:
            t = s
        else:
            t += (t - s) % f
        # i -> i+1に移動
        t += c

    print(t)
# Judge status: Accepted
import math
h,w = map(int,input().split())
if h == 1 or w == 1:
    print(1)
else:
    print(math.ceil(h*w/2))
# Judge status: Accepted
s=set(input())
if len(s)==4:
    print("Yes")
elif len(s)%2:
    print("No")
else:
    if ("N" in s and "S" in s) or ("W"in s and "E" in s):
        print("Yes")
    else:
        print("No")
# Judge status: Wrong Answer
import sys


def solve(inp):
    N = int(inp.readline().strip())
    B = list(map(int, inp.readline().strip().split(' ')))

    A = [0 for i in range(N)]
    A[N - 1] = B[N - 2]
    A[0] = B[0]
    n = N - 2
    while n >= 1:
        A[n] = min(B[n], B[n - 1])
        n -= 1

    # print(" ".join(map(str, A)))
    return sum(A)


def main():
    result = solve(sys.stdin)
    if result:
        print(result)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
A,B=map(int,input().split())
if A>=13:
  print(B)
elif 6<=B<=12:
  print(B//2)
else:
  print(0)
# Judge status: Wrong Answer
a=int(input())
b=int(input())
c=int(input())
d=int(input())
print(int((c*a)+d*(b-a)))
# Judge status: Accepted
n = int(input())
k = int(input())
x = int(input())
y = int(input())

ryoukin = 0
if n <= k:
    ryoukin = x * n
else:
    ryoukin = k * x + (n - k) * y

print(ryoukin)
# Judge status: Accepted
N = int(input())
S_ = input()
s=S_

count = 0
new_left = 0
new_right = 0

for si in s:
    if si == '(':
        count += 1
    else:
        count -= 1

        if count == -1:
            count = 0
            new_left += 1

new_right = count
print('(' * new_left + s + ')' * new_right)
# Judge status: Accepted
N, K = map(int, input().split())
A = [0] * N

for i in range(K):
  D = int(input())
  B = list(map(int, input().split()))
  for j in range(D):
    A[B[j] - 1] += 1
    
print(A.count(0))
# Judge status: Accepted
c_1 = list(input())
c_2 = list(input())

if c_1[0] == c_2[2] and c_1[1] == c_2[1] and c_1[2] == c_2[0]:
    print("YES")

else:
    print("NO")
# Judge status: Wrong Answer
from itertools import combinations
n, m, x = map(int, input().split())

def aryadd(ary):
    a = []
    for i in zip(*ary):
        a.append(sum(i))
    return a

a = []
for i in range(n):
    a.append(list(map(int, input().split())))

ans = 10**10
for i in range(2, n+1):
    for j in combinations(a, i):
        sm = aryadd(j)
        if len(list(filter(lambda y: y >= x, sm[1:]))) >= m:
            if ans >= sm[0]:
                ans = sm[0]

if ans == 10**10:
    print(-1)
else:
    print(ans)
# Judge status: Wrong Answer
N = int(input())
A = sorted(map(int, input().split()), reverse=False)
dp = [0] * (max(A)+1)

for i in range(N):
    if dp[A[i]] == 0:
        dp[A[i]] = 1
        for j in range(i+1, N):
            if dp[A[j]] == 0 and A[j] % A[i] == 0:
                dp[A[j]] = 2
print(dp.count(1))
# Judge status: Accepted
S=input()
T=input()
ans=0
for i in range(len(S)):
    if(S[i]!=T[i]):
        ans+=1
print(ans)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
cnt = n//2
ans=abs(sum(a[:cnt]) - sum(a[cnt:]))

for i in range(1,cnt):
    if ans > abs(sum(a[:cnt+i]) - sum(a[cnt+i:])):
        ans = abs(sum(a[:cnt+i]) - sum(a[cnt+i:]))
    else:
        break
for i in range(1,cnt):
    if ans > abs(sum(a[:cnt-i]) - sum(a[cnt-i:])):
        ans = abs(sum(a[:cnt-i]) - sum(a[cnt-i:]))
    else:
        break

print(ans)
# Judge status: Accepted
import queue
target = int(input())

q = queue.Queue()

for i in range(1,10):
  q.put(str(i))


for cnt in range(1, target):
  num = q.get()
  mod = int(num) % 10
  
  if mod == 0:
    q.put(num + "0")
    q.put(num + "1")
  elif mod == 9:
    q.put(num + "8")
    q.put(num + "9")
  else:
    q.put(num + str(mod - 1))
    q.put(num + str(mod))
    q.put(num + str(mod + 1))

print(q.get())
# Judge status: Wrong Answer
a,b = map(int, input().split())
if a < 10:
  c=int(b-100*(10-a))
else:
  c=int(b)
print(c)
# Judge status: Wrong Answer
input_X = int(input())

result_500 = input_X // 500
result_500ureshi = result_500 * 1000
result_5ureshi = (input_X - result_500 * 500) // 5 * 5

print(result_500ureshi)
print(result_5ureshi)
result = int(result_500ureshi + result_5ureshi)
print(result)
# Judge status: Wrong Answer
l, r, d = map(int, input().split())
result=0

for i in range(r-l+1):
    if (r+i) % d == 0:
        result+=1
print(result)
# Judge status: Accepted
n,x = map(int,input().split())
l = list(map(int,input().split()))
count = 0
for i in range(n-1):
  if l[i]>x:
    count += (l[i]-x)
    l[i] -= (l[i]-x)
  if l[i]+l[i+1]>x:
    count += (l[i]+l[i+1]-x)
    l[i+1] -= (l[i]+l[i+1]-x)
print(count)
# Judge status: Wrong Answer
# AtCoder Beginner Contest 097
# B - Exponential

X=int(input())
for i in range (X):
    a= (X-i)**0.5
    if a==int(a):
        print(int(a)**2)
        exit()
# Judge status: Accepted

N = int(input())
min = 1000000000

for i in range(1,N):
    A = str(N - i)
    B = str(i)
    temp = 0
    for j in range(len(A)):
        temp += int(A[j])
    for j in range(len(B)):
        temp += int(B[j])
    if min > temp:
        min = temp
print(min)
# Judge status: Accepted
x,y=map(int,input().split())
ans=1
for i in range(1000):
  x=x*2
  ans+=1
  if x>=y:
    break
print(ans+(0 if x==y else (-1)))
# Judge status: Accepted
s1=input()
s2=input()

cnt=0
for i in range(len(s1)):
    if s1[i]==s2[-i-1]:
        cnt+=1

if cnt == 3:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
N,M = list(map(int,input().split()))
MAX = float('-inf')
MIN = float('inf')
for i in range(M):
    L,R = list(map(int,input().split()))
    MAX = max(MAX, L)
    MIN = min(MIN, R)
count = MIN - MAX + 1
if count > 0:
    print(count)
else:
    print(0)
# Judge status: Accepted
n , m = map(int,input().split())
iki = set()
nori = set()
for i in range(m):
    a , b = map(int,input().split())
    if a == 1:
        iki.add(b)
    if b == n:
        nori.add(a)

if iki.isdisjoint(nori):
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")
# Judge status: Accepted
x = int(input())
ans = 0
val = 100
while val < x:
    val = int(val * 1.01)
    ans += 1
print(ans)
# Judge status: Accepted
m = int(input())
if m==1:
    print(0)
    exit()
pf={}
for i in range(2,int(m**0.5)+1):
    while m%i==0:
        pf[i]=pf.get(i,0)+1
        m//=i
if m>1:pf[m]=1
key=list(pf.keys())
used=[0]*len(key)
#print(pf)
cnt=0
for i in range(len(key)):
    k=key[i]
    tmp=0
    while pf[k]>used[i]+tmp:
        tmp+=1
        used[i]+=tmp
        cnt+=1
        #print(used,tmp)
print(cnt)
# Judge status: Accepted
a,b=map(lambda x:(int(x)+13)%15,input().split())
print("Alice" if a>b else "Bob" if a<b else "Draw")
# Judge status: Accepted
N, M = map(int, input().split())
table = [[int(i) for i in input().split()] for _ in range(M)]

ans = [table[0][0], table[0][1]]
cnt = 0

for i in table[1:]:
    if ans[0] <= i[0] <= ans[1]:
        ans[0] = i[0]
    if ans[0] <= i[1] <= ans[1]:
        ans[1] = i[1]
    if ans[1] < i[0] or i[1] < ans[0]:
        cnt += 1
        break

if cnt != 0:
    print(0)
else:
    print(ans[1] - ans[0] + 1)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
print(max(c,a//b))
# Judge status: Accepted
ma = lambda :map(int,input().split())
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
n = ni()
cs = input()
r = cs.count("R")
print(cs[r:].count("R"))
# Judge status: Accepted
N,C,K = map(int,input().split())
T = [int(input()) for _ in range(N)]
T.sort()
cnt = 0
pas = 0
time = T[0]
for i in range(N-1):
    pas += 1
    if pas and T[i] - time > K:
        pas,time = 1,T[i]
        cnt += 1
        continue
    if pas == C:
        pas,time = 0,T[i+1]
        cnt += 1
print(cnt+1+(pas and T[N-1]-T[N-2]>=K))
# Judge status: Wrong Answer
a, b, c=map(int, input().split())
if a==b and b==c:
  print(-1)
else:
  cnt=0
  while(1):
    if a%2==1 or b%2==1 or c%2==1:
      print(cnt)
      break
    cnt+=1
    ha=a/2
    hb=b/2
    hc=c/2
    a=hb+hc
    b=ha+hc
    c=ha+hb
# Judge status: Accepted
n = int(input())
sn = [input() for _ in range(n)]
ans = ''
for s in sorted(set(sn[0])):
    cnt = min([sn[i].count(s) for i in range(n)])
    ans += s*cnt
print(ans)
# Judge status: Accepted
s = input()
aiueo = ["a", "i", "u", "e", "o"]
if s in aiueo:
    print("vowel")
else:
    print("consonant")
# Judge status: Accepted
import math
import heapq
n, m = map(int, input().split())
a = [int(i) * (-1) for i in input().split()]
heapq.heapify(a)
i = 0
while i < m:
    max_a = - heapq.heappop(a)
    max_a /= 2
    heapq.heappush(a, -max_a)
    i += 1
total = 0
for k in a:
    total += math.floor(-k)
print(total)
# Judge status: Accepted
n, r = map(int,input().split())
if n >= 10:
  print(r)
else:
  print(r + 100 * (10 - n))
# Judge status: Wrong Answer
A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
b = [int(input()) for i in range(N)]


def main(A, b):
    for i in range(3):
        for j in range(3):
            if not A[i][j] in b:
                break
            return "Yes"

    if (A[0][0] and A[1][1] and A[2][2]) in b:
        return "Yes"

    if (A[0][2] and A[1][1] and A[2][0]) in b:
        return "Yes"

    return "No"


ans = main(A, b)
print(ans)
# Judge status: Wrong Answer
n=int(input())
cnt=0

for i in range(1, n):
    l=len(str(i))
    if l%2==1:
        cnt+=1

print(cnt)
# Judge status: Wrong Answer
n, k= map(int, input().split())
a = list(map(int, input().split()))
print(len(set(a))-k+1 if len(set(a))>k else 0)
# Judge status: Accepted
C = [list(map(int, input().split())) for _ in range(3)]

x = C[0][0]
a = [c[0] - x for c in C]
b = [C[0][i]-a[0] for i in range(3)]

ans = "Yes"
for i in range(3):
    for j in range(3):
        if C[i][j] != a[i] + b[j]:
            ans = "No"

print(ans)
# Judge status: Accepted
S = input()
NS = set()
EW = set()
for s in S:
  if s in ["N", "S"]:
    NS.add(s)
  if s in ["E", "W"]:
    EW.add(s)
if len(NS) == 1 or len(EW) == 1:
  print("No")
else:
  print("Yes")
# Judge status: Accepted
if __name__ == "__main__":
    S = input()
    T = input()

    lenS = len(S)
    if (T[:lenS] == S and len(T) == lenS + 1):
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
a = input()
if "A"<=a<="Z":
    print("A")
elif "a"<=a<="z":
    print("a")
# Judge status: Accepted
N = int(input())
lst = list(map(int, input().split()))

flag = True
count = 0
while flag:
    for i in range(N):
        if lst[i]%2 == 0:
            lst[i] = lst[i]/2
        else:
            flag = False
            
    count += 1
print(count-1)
# Judge status: Accepted
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = list(input())

d = {'r': p, 's': r, 'p': s} #勝ちスコア

point = 0
for i in range(k): #kまでは普通に勝ってもよい
    point += d[t[i]]

for i in range(k, n): #kからnまでは、k個前と同じなら、後の方を無得点化する
    if t[i] == t[i - k]:
        t[i] = 'x'
        continue
    point += d[t[i]]

print(point)
# Judge status: Accepted
N,K=map(int,input().split())
hoge=[0 for j in range(N)]
for j in range(K):
    input()
    for i in input().split():
        hoge[int(i)-1]+=1
print(sum([j==0 for j in hoge]))
# Judge status: Accepted
W,H,N=map(int,input().split())

# 左下の座標
X=Y=0

for i in range(N):
  # 入力
  x,y,a=map(int,input().split())

  if a==1:
    X=max(X,x)
  elif a==2:
    W=min(W,x)
  elif a==3:
    Y=max(Y,y)
  else:
    H=min(H,y)

# 出力
print(max(W-X,0)*max(H-Y,0))
# Judge status: Wrong Answer
n = int(input())
l_list = [2, 1]
if n < 2 :
    print(l_list[n])
else :
    for i in range(2,n+1) :
        new = l_list[i-1] + l_list[i-2]
        l_list.append(new)
print(l_list[n])
# Judge status: Accepted
n = int(input())
A = sorted(list(map(int, input().split())))
from collections import Counter
c = Counter(A)

dp = [1]*(max(A)+1)
#print(dp)
for i in c.keys():
    j = i*2
    while j<len(dp):
        dp[j] = 0
        j += i
        #print(j, end=',')
ans = 0
for i in c.keys():
    if c[i] == 1:
        if dp[i] == 1:
            ans += 1
print(ans)
# Judge status: Wrong Answer
N = int(input())
l = []
for i in range(N):
  l.append(int(input()))
  
ans = 0
for i in range(N):
  ans += l[i] // 2
  l[i] = l[i] % 2
  if (0<i) and (l[i-1]+l[i]==2):
    ans += 1
    l[i-1], l[i] = 0, 0
print(ans)
# Judge status: Accepted
S = list(input())
for i in range(len(S)):
    S[i] = int(S[i])

K = int(input())

start = 1
loc = 101
for i in range(len(S)):
    if S[i] != 1:
        start = S[i]
        loc = i
        break

if K > 100:
    print(start)
elif K-1 >= loc:
    print(start)
else:
    print(1)
# Judge status: Wrong Answer
X = int(input())
S = 100
k = 0
while S < X:
  S = round(S*1.01)
  k += 1
print(k)
# Judge status: Wrong Answer
n = input()
digits = []
num_notes = 0
carry = 0
for _d in n[::-1]+'0':
    d = int(_d) + carry
    if d <= 5:
        num_notes += d
        carry = 0
    else:
        num_notes += (10 - d)
        carry = 1
print(num_notes)
# Judge status: Accepted
import sys
input = sys.stdin.readline

P=list(map(int,input().split()))
print(sum(P)-max(P))
# Judge status: Wrong Answer
abc = sorted(list(map(int,input().split())))
x = abc[0]
y = abc[1]
z = abc[2]
cnt = (z-x)//2 + (z-y)//2
if z == 2*((z-x)//2)+x and z == 2*((z-y)//2)+y:
    print(cnt)
elif z > 2*((z-x)//2)+x and z > 2*((z-y)//2)*y:
    print(cnt + 1)
else:
    print(cnt + 2)
# Judge status: Accepted
import bisect
n,m=map(int,input().split())
a=dict()
b=[]
for i in range(m):
    p,y=map(int,input().split())
    b.append((p,y))
    if p not in a:
        a[p]=[y]
    else:
        a[p]+=[y]
for i,l in a.items():
    a[i]=sorted(l)
for p,y in b:
    index=bisect.bisect_left(a[p],y)+1
    a1=str(p).zfill(6)
    a2=str(index).zfill(6)
    print(a1+a2)
# Judge status: Accepted
s=int(input())
a=set()
a.add(s)
cnt=2

while True:
  if s%2:
    t=3*s+1
  else:
    t=s//2
  if t in a:
    print(cnt)
    exit(0)
  a.add(t)
  cnt+=1
  s=t
# Judge status: Accepted
import sys
import math
import bisect

def main():
    a, b, c = map(int, input().split())
    a, b = min(a, b), max(a, b)
    if c >= a and c <= b:
        print('Yes')
    else:
        print('No')
    
if __name__ == "__main__":
    main()
# Judge status: Accepted
#-------------
N = int(input())
#-------------
cnt = 0
while True:
    X = 2**cnt
    if N//2 >= X:
        cnt +=1
    else:
        break
print(X)
# Judge status: Wrong Answer
S=input()
T=input()
S=list(S)
T=list(T)
for i in range(len(S)):
    if(S[i]!=T[i]):
        S[i]=T[i]
print(i+1)
# Judge status: Wrong Answer
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Created: Jul, 14, 2020 11:34:55 by Nobody
# $Author$
# $Date$
# $URL$
__giturl__ = "$URL$"


from sys import stdin
input = stdin.readline


def main():
  N = int(input())

  print(int((N-1)*N/2))


if(__name__ == '__main__'):
  main()
# Judge status: Wrong Answer
N, A, B = map(int, input().split())

ans = int(N / (A + B))

r = N % (A + B)

ans = ans + min(r, A)

print(ans)
# Judge status: Wrong Answer
N=int(input())
p=list(map(int,input().split()))
ans=0
for i in range(N-1):
    if i+1==p[i]:
        temp=p[i+1]
        p[i+1]=p[i]
        p[i]=temp
        ans+=1
print(ans)
# Judge status: Accepted
import numpy as np

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


BW = np.zeros([H,W])

for i in range(N):
    x, y, a = map(int, input().split())
    if a == 1:
        BW[:, :x] = 1
    elif a == 2:
        BW[:, x:] = 1
    elif a == 3:
        BW[H-y:, :] = 1
    elif a == 4:
        BW[:H-y, :] = 1
print(np.count_nonzero(BW-1))
# Judge status: Accepted
X,K,D=map(int,input().split())
X=abs(X)

m=min(K,X//D)
X-=D*m
K-=m
K%=2
X-=D*K
print(abs(X))
# Judge status: Accepted
X = int(input())

k = 1
while True:
    if (X * k) % 360 == 0:
        print(k)
        exit()
    k += 1
# Judge status: Accepted
a = int(input())

a2 = a*a
a3 = a2*a

print(a + a2 + a3)
# Judge status: Accepted
a = []
for i in range(5):
    a.append(input())
ans = 0
a.sort(key = lambda x: x[-1])
flag = True
for s in a:
    if s[-1] == '0' and flag:
        ans += int(s)
    elif flag:
        ans += int(s)
        flag = False
    else:
        x = int(s[-1])
        ans += int(s) + 10 -x
print(ans)