peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
s=str(input())
s=list(s)
temp=[0]*(len(s)+1)
cnt=0
ans=0
for i in range(len(s)):
  if s[i]=="<":
    if temp[i]<0:
      ans=ans+abs(cnt*temp[i])
      temp[i+1]=1
    else:
      temp[i+1]=temp[i]+1
    if temp[i]>0:
      cnt=0
    else:
      cnt=1
  else:
    if temp[i]>0:
      temp[i+1]=0
    else:
      temp[i+1]=temp[i]-1
    cnt=cnt+1
print(sum(temp)+ans)
# Judge status: Accepted
n=int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

m=0
# 0で初期化すると最初が1の時にだめ
at=-1
for ai in a:
    m+=b[ai-1]
    if ai == at+1:
        m+=c[at-1]
    at=ai
print(m)
# Judge status: Wrong Answer
s=0
A,B=map(int,input().split())
if A>=B:
  s+=A
  A=A-1
else:
  s+=B
if A>=B:
  s+=A
  A=A-1
else:
  s+=B
print(s)
# Judge status: Accepted
import sys
N=int(sys.stdin.readline().strip())
A=map(int, sys.stdin.readline().split())

for i,a in enumerate(A):
    if i==0:
        total=a
    else:
        total^=a

for a in A:
    print a^total,
# Judge status: Accepted
N,A,B,C,D = map(int,input().split())
S = input()
if '##' in S[A:C]:
    print('No')
elif '##' in S[B:D]:
    print('No')
elif C>D:
    #print(S[B - 2:D + 1])
    if not '...' in S[B-2:D+1]:
        print('No')
    else:
        print('Yes')
else:
    print('Yes')
# Judge status: Accepted
n,h=map(int,input().split())

b = []
t = []
for _ in range(n):
    c,d = map(int,input().split())
    b.append(c)
    t.append(d)


b_max = max(b)
t =sorted(t)

from bisect import bisect_right
from math import ceil
index = bisect_right(t,b_max)

ans=0
for i in range(n-1,index-1,-1):
    h-=t[i]
    ans+=1
    if h<=0:
        print(ans)
        exit(0)

cnt = ceil(h/b_max)

print(ans+cnt)
# Judge status: Accepted
d=int(input())
print("Christmas"," Eve"*(25-d))
# Judge status: Accepted
# coding: utf-8

def get_ans():
    n = int(input().rstrip())
    if n == 0:
        return "0"
    dv = 1
    bit_list = []
    while n != 0:
        tmp = n % (dv*2)
        if tmp == 0:
            bit_list.append("0")
        else:
            bit_list.append("1")
        n -= tmp
        dv *= -2
    return "".join(reversed(bit_list))


print(get_ans())
# Judge status: Accepted
r,g,b=map(int,input().split())
if (100*r+10*g+b) % 4 == 0:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n = int(input())
A = []
maximum = 0
maximum_idx = 0
for i in range(n):
    a = int(input())
    A.append(a)
    if a > maximum:
        maximum = a
        maximum_idx = i

for i in range(n):
    if i != maximum_idx:
        print(maximum)
    else:
        print(sorted(A)[-2])
# Judge status: Accepted

s = list(input())
t = list(input())
a = ""
status = 0

if s == t:
    print("Yes")
    status = 1
else:
    for i in range(len(s)):
        a = s.pop()
        s.insert(0,a)
        if s == t:
            print("Yes")
            status = 1
        else:
            pass

if status == 0:
    print("No")
# Judge status: Accepted
D = int(input())
if D == 25:
    print("Christmas")
elif D==24:
    print("Christmas Eve")
elif D==23:
    print("Christmas Eve Eve")
else:
    print("Christmas Eve Eve Eve")
# Judge status: Accepted
import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9

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

    if a*b%2 == 0:
        print('Even')
    else:
        print('Odd')


if __name__ == '__main__':
    main()
# Judge status: Accepted
n,a,b= list(map(int, input().strip().split()))
k=int(n/(a+b))
if n-k*(a+b)>=a:
  print((k+1)*a)
else:
  print(n-k*b)
# Judge status: Wrong Answer
x = int(input())
import math

steps = 1
X = x

a,b = math.sin((22*x)/(7*180)),math.cos((22*x)/(7*180))
while True:
    # print(x,a,b)
    x = (x+X)
    r = (22*x)/(7*180)
    a = a + math.sin(r)
    b = b + math.cos(r)
    steps+=1
    if a<10**-6 and b<10**-6:
        break
    
    
print(steps+1)
# Judge status: Accepted
N,M=map(int, input().split())
A=[[] for i in range(N)]
 
for i in range(M):
  p,y=map(int, input().split())
  A[p-1].append((y, i))
 
X=[0]*M
for i,d in enumerate(A):
  d.sort()
  for k,(y,j) in enumerate(d):
    X[j]=str(i+1).zfill(6)+str(k+1).zfill(6)
print(*X,sep='\n')
# Judge status: Wrong Answer

# dp[i] 足場iまでいくコストの最小値

n,k = map(int,input().split())
h = [0] + list(map(int,input().split()))

# dp[2]までは初期条件で確定
dp = [0 for i in range(n+1)]
dp[2] = abs(h[2]-h[1])

for i in range(3,n+1):
    arr = [dp[i-j] + abs(h[i] - h[i-j]) for j in range(1,min(i,k)+1)]
    dp[i] = min(arr)


ans = dp[n]
print(ans)
# Judge status: Wrong Answer
import collections
w=list(input())
W=collections.Counter(w)
ans="Yes"
for i in W.values():
    if i%2!=0:
        ans="NO"
        break

print(ans)
# Judge status: Accepted
s = input()
t = input()
counter = 0
for i in range(0, len(s)):
  if s[i] != t[i]:
    counter += 1
print(counter)
# Judge status: Accepted
A,B = [int(i) for i in input().split()]
c = 0
for n in range(A,B+1):
    c += str(n) == str(n)[::-1]
print(c)
# Judge status: Wrong Answer
n = int(input())
s = input()
t = input()

tyouhuku = 0
for i in range(n):
    if s[i:]==t[:n-i]:
        tyouhuku = n-i
        
print(max(n,2*n-tyouhuku))
# Judge status: Wrong Answer
import numpy as np

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

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

win = 0
for i in range(N):
	for j in range(i+1, N):
		if x[i] + x[j] >= H:
			win = 1
			print("Yes")
			break
	if win == 1:
		break


if win == 0:
	print("No")
# Judge status: Wrong Answer
X = int(input())

for a in range(0, 10**9):
    bb = X - a**5
    B = bb**0.2

    if isinstance(B, float):
        if B.is_integer():
            print(a, int(B))
            break

    a *= -1
    bb = X - a**5
    B = bb**0.2
    if isinstance(B, float):
        if B.is_integer():
            print(a, int(B))
            break
# Judge status: Accepted
n, m = map(int, input().split())
if(n>m):print(str(m)*n)
else:print(str(n)*m)
# Judge status: Accepted
s = input()

answer = 'Yes'

for i in range(len(s)):
    if i%2 == 0:
        if s[i] == 'L':
            answer = 'No'
            break  
    else:
        if s[i] == 'R':
            answer = 'No'
            break
            
print(answer)
# Judge status: Accepted
N = int(input())
A = [-1] + [int(x) for x in input().split()]
B = [0] + [int(x) for x in input().split()]
C = [0] + [int(x) for x in input().split()]

ans = 0

for i in range(1, N + 1):
    ans += B[A[i]]
    if A[i] == A[i - 1] + 1:
        ans += C[A[i - 1]]

print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())

ans = 'NO'
if a < b and c%a == 0:
  ans = 'YES'
else:
  for i in range(1, 10000):
    if (b*i + c)%a == 0:
      ans = 'YES'
      break
  
print(ans)
# Judge status: Accepted
S=str(input())
if S[0]==S[1] or S[1]==S[2] or S[2]==S[3]:
  print('Bad')
else:
  print('Good')
# Judge status: Accepted
n = input()
a = list(map(int, input().split()))
ans = True
for x in a:
    if x % 2 == 0:
        if not(x % 3 == 0 or x % 5 == 0):
            ans = False
            break
print('APPROVED') if ans else print('DENIED')
# Judge status: Wrong Answer
s=[]
s=input()
if str.islower(s)==True and s[2]==s[3] and s[4]==s[5] and s[3]!=s[4] and s[0]!=s[1] and s[1]!=s[2]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
from collections import defaultdict
from collections import deque
from collections import Counter
import math

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

d,t,s = readInts()

if d<=t*s:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
h=int(input())
w=int(input())

n=int(input())
a=max(h,w)
count=1
while a*count<n:
    count+=1

print(min(count,h,w))
# Judge status: Accepted
n,l=map(int,input().split())

aji = [l+i for i in range(n)]
ans = None
sa=10**10
for i in range(n):
    sa_tmp=abs(aji[i])
    if sa>sa_tmp:
        sa=sa_tmp
        ans=sum(aji)-aji[i]
print(ans)
# Judge status: Wrong Answer
a = list(map(int, input().split()))
n = int(input())
a[0] *= 8
a[1] *= 4
a[2] *= 2

if n % 2 == 0:
    val = min(a)
    print((n//2)*val)
else:
    val = min(a[:3])
    if n > 2 and val > a[-1]:
        print(int((n//2)*a[-1]+val/2))
    else:
        print(int(n*val/2))
# Judge status: Wrong Answer
import math
inp = list(map(int,input().split()))
a=inp[0]
b=inp[1]
x=inp[2]
k=(2*(a*a*b-x))/(a**3)
print (math.atan(k))
# Judge status: Wrong Answer
n,k=map(int,input().split())
print((n+1)*(k+n+1)*(n+2-k)//2+k*(k-1)*(2*k-1)//6-(n+2)*(n+1)*(2*n+3)//6+n+2-k)
# Judge status: Accepted
n, p = map(int,input().split())
a = list(map(int,input().split()))
 
o = 0
for i in a:
    if  i % 2:
        o += 1 
e = n-o
if o != 0:
    print((2**e)*int(2**(o-1)))
else:
    if p == 0:
        print(2**n)
    else:
        print(0)
# Judge status: Accepted
N = int(input())
Xls = list(map(int,input().split()))
X2ls = sorted(Xls)
M1 = X2ls[N//2-1]
M2 = X2ls[N//2]
lsans = []
for i in range(N):
    if Xls[i] <= M1:
        M = M2
    else:
        M = M1
    lsans.append(M)
for i in lsans:
    print(i)
# Judge status: Accepted
a,b,c=map(int,input().split())
q=1
for i in range(b):
    if a*i%b==c:
        q=0
        break
if q==0:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
import numpy as np
n = int(input())
a_ls = list(map(int, input().split()))

# -1, 0, 右端も用意
updown_ls = [0] * (10**5 + 3)

for i in range(n):
    left = a_ls[i] 
    right = a_ls[i] + 3
    updown_ls[left] += 1
    updown_ls[right] -= 1

updown_ls.pop()
num_ls = list(np.cumsum(updown_ls))
print(max(num_ls))
# Judge status: Wrong Answer
x = int(input())
if x == 3 or 5 or 7:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
A,B,C = map(int,input().split())
if A%2 != 0 or B%2 != 0 or C%2 != 0:
    print(0)
    exit()
if A*2 == B+C and B*2 == A+C and C*2 == A+B:
    print(-1)
    exit()
ans = 0
for i in range(10000):
    a = A//2
    b = B//2
    c = C//2
    if A%2 == 0 and B%2 == 0 and C%2 == 0:
        ans += 1
        A = b+c
        B = a+c
        C = a+b
    else:
        print(ans)
        exit()
# Judge status: Accepted
# ABC 099: A – ABD
n = int(input())
print('ABC' if n < 1000 else 'ABD')
# Judge status: Accepted
INF = 10**9

H, N = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
dp = [INF for i in range(H+1)]

dp[0] = 0

for i in range(N):
    a = AB[i][0]
    b = AB[i][1]
    for j in range(H+1):
        next_j = min(j+a, H)
        dp[next_j] = min(dp[next_j], dp[j]+b)

print(dp[H])
# Judge status: Accepted
S = input()
ans = 0
for i in range(1, len(S)):
  s = S[: -2*i]
  l = (len(S) - 2*i) // 2
  if s[:l] == s[l:]:
    ans = len(S) - 2*i
    break
print(ans)
# Judge status: Accepted
S = input()

if 'N' in S or 'S' in S:
    if 'S' not in S or 'N' not in S:
        print('No')
        exit()

if 'E' in S or 'W' in S:
    if 'W' not in S or 'E' not in S:
        print('No')
        exit()

print('Yes')
# Judge status: Accepted
a, b, c = map(int, input().split())
if a == b == c and a%2 == 0:
  print(-1)
elif a%2 or b%2 or c%2:
  print(0)
else:
  ans = 0
  while a%2 == b%2 == c%2 == 0:
    a, b, c = (b+c)//2, (a+c)//2, (a+b)//2
    ans += 1
  print(ans)
# Judge status: Wrong Answer
s = input()
cnt1 = 0
cnt2 = 0
for i in range(len(s)):
    if i%2 == 0:
        if s[i] == "0":
            cnt1 += 1
        else:
            cnt2 += 1
    else:
        if s[i] == "1":
            cnt2 += 1
        else:
            cnt1 += 1
print(min(cnt1,cnt2))
# Judge status: Wrong Answer
import fractions
a,b= list(map(int, input().split()))
i= list(map(int, input().split()))

ans=0
l=[]
for j in range(a):
    l.append(abs(b-i[j]))
for k in range(1,a):
    if k==1:
        ans=abs(l[1]-l[0])
    else:
        ans=fractions.gcd(ans,abs(l[k]-l[k-1]))
print(ans)
# Judge status: Wrong Answer
h = int(input())
w = int(input())
n = int(input())
     
print(n // max(h, w))
# Judge status: Wrong Answer
N = int(input())

count = 0

for i in range(2, 10):
    if N%i == 0 and N//i <= 9:
        count += 1
print("Yes") if count >0 else print("No")
# Judge status: Wrong Answer
n = int(input())
print(n//2 / n)
# Judge status: Accepted
n,a,b = map(int,input().split())
saaa = a+b
s1 = n//saaa
nokori = n%saaa
if nokori >= a:
    nokori = a
else:
    nokori = nokori
ans = s1*a + nokori
print(ans)
# Judge status: Wrong Answer
s=sorted(set(input()))
ro='abcdefghijklmnopqrstuvwxyz'
if len(s)==len(ro):
    print('None')
else:
    for i in range(len(s)):
        if s[i]!=ro[i]:
            print(ro[i])
            break
        if s[-1]!=ro[len(ro)-1]:
            print('z')
            break
# Judge status: Wrong Answer
def main():
    t = input()
    s = t.replace('?D', 'PD').replace('??', 'PD').replace('?', 'D')
    print(s)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
# coding: utf-8
from collections import Counter
alp = "abcdefghijklmnopqrstyvwxyz"
S = []
count = {}
for a in alp:
    count[a] = 51
N = int(input())
for i in range(N):
    s = input()
    S.append(s[:])
ans = ""
for a in alp:
    cnt = 0
    min_ = 10**9
    for s in S:
        if a in s:
            cnt += 1
            min_ = min(min_, s.count(a))
    if cnt == N:
        ans += a * min_
print(ans)
# Judge status: Accepted
n = int(input())
li = list(map(int,input().split()))

from itertools import accumulate

lin = list(accumulate(li))
mi = 10**18
S = sum(li)

for i in range(n-1):
    ara = lin[i]
    sunu = S-ara
    mi = min(mi,abs(ara-sunu))

print(mi)
# Judge status: Accepted
from decimal import *
getcontext().prec = 30000
a, b, c = map(int, input().split())
#print(a **.5, b**.5,c**.5)
#print(a **.5+ b**.5,c**.5)
#print(Decimal(a).sqrt() , Decimal(b).sqrt() , Decimal(c).sqrt())
#if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt():
if 2 * Decimal(a * b).sqrt() + Decimal(b) + Decimal(a) < Decimal(c):
#if a **.5 + b**.5 < c**.5:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
X,Y,Z=map(int,input().split())
print(int((X-Z)/(Z+Y)))
# Judge status: Wrong Answer
import sys
S=input()
first=S[0]
last=S[len(S)-1]
cnt=0
moji=[i for i in "abcdefghijklmnopqrstuvwxyz"]
# print(len(moji))

if first=="A":
  for i in range(2,len(S)-1):
    if S[i]=="C":
      cnt+=1
    else:
      if (S[i] in moji)==False:
        print("WA")
        sys.exit()

  if cnt==1 and ((last in moji)==True):
    print("AC")
  else:
    print("WA")
        
else:
  print("WA")
# Judge status: Accepted
import sys
readline = sys.stdin.readline

N, R = map(int, readline().split())

ans = None
if N >= 10:
    ans = R
else:
    ans = R + 100*(10 - N)
print(ans)
# Judge status: Accepted
def main():
    import sys
    readline = sys.stdin.readline
    # readlines = sys.stdin.readlines
    H, N = map(int, input().split())
    M = [tuple(map(int, readline().split())) for _ in range(N)]
    INF = float('inf')
    dp = [INF] * (H + 1)
    dp[0] = 0
    
    for i in range(N):
        a, b = M[i]
        for j in range(H):
            nj = min(H, j + a)
            dp[nj] = min(dp[nj], dp[j] + b)

    print(dp[H])


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
k = int(input())
a,b = map(int, input().split())
c = b-a
for i in range(c, b+1):
    if i % k == 0:
      print('OK')
      break
    else:
      print("NG")
# Judge status: Accepted
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
L = abs(a - b)
s = v - w
if s <= 0 or L / s > t:
    result = "NO"
else:
    result = "YES"
print(result)
# Judge status: Accepted
def main():
    ans = [1, 2, 3]
    a = int(input())
    b = int(input())
    ans.remove(a)
    ans.remove(b)
    print(ans[0])
    

main()
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

import itertools
accum = list(itertools.accumulate(a))

ans = float('inf')
for i in range(n-1):
    ans = min(ans, abs((accum[-1] - accum[i]) - accum[i]))
print(ans)
# Judge status: Wrong Answer
"""
2文字 or 3文字だけ？
aa
bb
cc
二文字並ばないように並び替える
"""
S = input()
na = S.count("a")
nb = S.count("b")
nc = S.count("c")

nall = na+nb+nc
mx = max(na,nb,nc)
mn = min(na,nb,nc)
rest = nall - mx
if len(S) == 3 and mx == 2 and mn == 0:
    print("NO") 
else:
    if mx - rest >= 2:
        print("NO")
    else:
        print("YES")
# Judge status: Accepted
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
from math import ceil

x=ni()
p=x%100
if ceil(p/5) <= x//100:
  print(1)
else:
  print(0)
# Judge status: Accepted
#!/usr/bin/env python3
L, R = map(int, input().split())
l = L % 2019
r = R % 2019
if R - L < 2019 and r > l:
    print(
        min(i * j % 2019 for i in range(l, r + 1)
            for j in range(i + 1, r + 1)))
else:
    print(0)
# Judge status: Accepted

first_input = list(map(lambda x:int(x), input().split(" ")))
second_input = list(map(lambda x:int(x), input().split(" ")))

second_input.sort(reverse=True)
criteria = sum(second_input)/float(4*first_input[1])

count = 0
for i in range(len(second_input)):
    if second_input[i]>=criteria:
        count = count+1
    else:
        break

if count >= first_input[1]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
ab = [list(map(int, input().split())) for i in range(n)][::-1]

ans = 0
for a, b in ab:
    a += ans
    if a % b != 0:
        ans += b - a % b
print(ans)
# Judge status: Accepted


def resolve():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip())

    print(n + n*n + n*n*n)

if __name__ == "__main__":
    resolve()
# Judge status: Wrong Answer
n = int(input())
A = input()
A = A.split()
A = [int(i) for i in A]
A = sorted(A, reverse = True)
ans = 0

for x in A:
	ans += x

ans -= A[n-1]

print(ans)
# Judge status: Wrong Answer
A, B, C, K = map(int, input().split())

if K == 0:
    print(A-B)
    exit()

A, B, C = B+C, C+A, A+B

if abs(A-B) > 10**18:
    print('Unfair')
else:
    print(A-B)
# Judge status: Wrong Answer
n = int(input())
t = [0 for i in range(n)]
for i in range(n-1):
    c,s,f = map(int,input().split())
    for j in range(i+1):
        if t[j] <= s:
            t[j] = c + s
        elif t[j] % f:
            t[j] += c
        else:
            t[j] += f - (t[j] % f)
for i in t:
    print(i)
# Judge status: Accepted
N = int(input())
n = 1
while n*2 <= N:
    n *= 2
print(n)
# Judge status: Accepted
a, b, k = map(int, input().split())

if a >= k:
  print(a-k, b)
else:
  if b - (k-a) >= 0:
    print(0, b - (k-a))
  else:
    print(0, 0)
# Judge status: Accepted
k,s = map(int,input().split())
c = 0

for i in range(k+1):
    for j in range(k+1):
        #print(i,j)
        if (s - (i + j)) <= k and (i + j) <= s:
            c += 1

print(c)
# Judge status: Wrong Answer
from sys import stdin

A, B = [int(x) for x in stdin.readline().rstrip().split()]

if A*B <= 81:
    print(A*B)
else:
    print(-1)
# Judge status: Accepted
N = int(input())
a = [int(input()) for _ in range(N)]

count = 0
i = 1
for _ in range(N):
    i = a[i-1]
    count += 1
    if i == 2:
        print(count)
        break
else:
    print(-1)
# Judge status: Wrong Answer
import string

def dfs(w):
    if len(w) == N:
        print(w)
        return
    for i in range(N):
        dfs(w + string.ascii_lowercase[i])

N = int(input())
anslst = []
nlst = [0] * N
wordlst = string.ascii_lowercase
dfs('a')
# Judge status: Accepted
x1=list(map(int,input().split()))
x2=list(map(int,input().split()))
x3=list(map(int,input().split()))
n=int(input())
for _ in range(n):
  m=int(input())
  x1 =[0 if m==x else x for x in x1]
  x2 =[0 if m==x else x for x in x2]
  x3 =[0 if m==x else x for x in x3]

if sum(x1)*sum(x2)*sum(x3) ==0 or x1[0]+x2[0]+x3[0]==0 or x1[1]+x2[1]+x3[1]==0 or x1[2]+x2[2]+x3[2]==0 or x1[0]+x2[1]+x3[2]==0 or x1[2]+x2[1]+x3[0]==0:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
def main():
    N = int(input())

    ans = 0
    for X in range(1, N + 1):
        Y = N // X
        ans += Y * (Y + 1) * X // 2

    print(ans)


if __name__ == '__main__':
    main()

exit()
# Judge status: Wrong Answer
import itertools

S = list(input())
Idxs = list(itertools.combinations(range(len(S)), 2)) 

def ACGT(Word):
    for w in Word:
        if w not in ["A", "C", "G", "T"]:
            return 0
    return len(Word)

ans = 0

for s in S:
    if s in ["A", "C", "G", "T"]:
        ans = 1
        break


for idx in Idxs:
    tmp = S[idx[0]:idx[1]]
    ans = max(ans, ACGT(tmp))
    
print(ans)
# Judge status: Accepted
def tmp(n):
    if n >= 1800 and n < 2000:
        return 1
    elif n >= 1600 and n < 1800:
        return 2
    elif n >= 1400 and n < 1600:
        return 3
    elif n >= 1200 and n < 1400:
        return 4
    elif n >= 1000 and n < 1200:
        return 5
    elif n >= 800 and n < 1000:
        return 6
    elif n >= 600 and n < 800:
        return 7
    elif n >= 400 and n < 600:
        return 8
    
n = int(input())
print(tmp(n))
# Judge status: Accepted
a = [int(input())]
b = [int(input())]
l = [1, 2, 3]
ans = set(l) - set(a) -set(b)
print(list(ans)[0])
# Judge status: Wrong Answer
from bisect import *

n = int(input())
l = sorted(list(map(int, input().split())))

cnt = 0

for i in range(n):
    a = l[i]
    for j in range(i+1, n):
        b = l[j]
        lower = bisect_right(l, b)
        upper = bisect_left(l, a+b)
        cnt += upper - lower
print(cnt)
# Judge status: Accepted
n,p = map(int,input().split())
a = list(map(int,input().split()))
odd = [i for i in a if i%2==1]
eve = [i for i in a if i%2==0]
odd_len = len(odd)
eve_len = len(eve)
if p==0:
    ans = 2**eve_len
else:
    ans = 0
count = 0
if p==0:
    if odd_len!=0:
        ans *= 2**odd_len//2
else:
    ans +=   (2**eve_len)*(2**odd_len//2)
print(ans)
# Judge status: Accepted
def main():
    n = int(input())
    print((n // 2 + n % 2)/n)


if __name__ == "__main__":
    main()
# Judge status: Accepted
import sys
input = sys.stdin.readline  #文字列入力では注意！
from bisect import bisect
N = int(input())
XL = [list(map(int,input().split())) for _ in range(N)]
S = []
for x,l in XL:
    S.append([x-l,x+l])

S.sort(key=lambda x: x[1])
ans = 1
mi = S[0][1]
for i in range(1,N):
    if mi <= S[i][0]:
        mi = S[i][1]
        ans += 1
print(ans)
# Judge status: Accepted
N,A,B,C,D = map(int,input().split())
S = str(input())
E = max(C,D)
AE = S[A:E]
BD = S[B-2:D+1]
if "##" in AE:
  print("No")
elif C > D and "..." not in BD:
  print("No")
else:
  print("Yes")
# Judge status: Wrong Answer
n = int(input())
p = list(map(int, input().split()))

count=0
for name in range(len(p)-1):
  if ((p[name+1] > p[name]) and (p[name] > p[name-1])) or ((p[name-1] > p[name])and (p[name] > p[name+1])):
    count+=1
print(count)
# Judge status: Accepted
#n = int(input())
a, b, c, x, y = map(int, input().split())
#al = list(map(int, input().split()))
#al=[list(input()) for i in range(n)]
mn = a*x+b*y
for i in range(0, max(x, y)+1):
    mn = min(mn, max(x-i, 0)*a+max(y-i, 0)*b+2*i*c)
print(mn)
# Judge status: Accepted
n, y = map(int, input().split())
A = list(map(str, [input() for i in range(n)]))
list.sort(A, reverse=False)
print(''.join(A))
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
if a>b>c or a>c>b:
    print(10*a+b+c)
elif c>a>b or c>b>a:
    print(10*c+a+b)
else:
    print(10*b+a+c)
# Judge status: Accepted
def resolve():
    import math
    n = int(input().replace(' ', ''))
    n = math.sqrt(n)
    if str(n)[-2:] == '.0':
        print('Yes')
    else:
        print('No')

resolve()
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
S = 1000
flag = 0
K = 0
for i in range(N-1):
  if A[i] < A[i+1] and flag == 0:
    K = S//A[i]
    S = S - K*A[i]
    flag = 1
  if A[i] > A[i+1] :
    S += K*A[i]
    K = 0
    flag = 0
S += K*A[N-1]
print(S)
# Judge status: Wrong Answer
import math
a,b,n = map(int,input().split())

temp = a * b // math.gcd(a, b) - 1
temp = min(temp, n)
ans = (a * temp)//b - a * (temp//b)
print(ans)
# Judge status: Wrong Answer
N, M = map(int, input().split())

num1 = N // 2
num2 = (N // 2) + 1
for i in range(M):
    print(num1-i, num2+i)
# Judge status: Accepted
N = input()

list_num = list(N)

A = [int(s) for s in list_num]

if sum(A) % 9 == 0:
    print('Yes')
else:
    print('No')