peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
from collections import deque

n = int(input())
a = list(map(int, input().split()))
if 1 in a:
    count = 0
    num = 1
    for i in a:
        if num == i:
            num += 1
        else:
            count += 1
    print(count)
else:
    print(-1)
# Judge status: Accepted
import math
s = input()
S = s[::-1]
count = 0
for i in range(0, len(s)):
  if s[i] != S[i]:
    count += 1
print(math.floor(count/2))
# Judge status: Accepted
import numpy as np
import itertools
import math

n = int(input())

towns = []

for i in range(n):
    towns.append(list(map(int, input().split())))

towns = np.array(towns)

l = np.zeros((n, n))

for i in range(n):
    for j in range(n):
        l[i, j] = np.sum((towns[i] - towns[j])**2) ** 0.5

ans = 0
for order in itertools.permutations(range(n), n):
    now = order[0]
    f = 0
    for i in order[1:]:
        f += l[now, i]
        now = i
    ans += f
print(ans/math.factorial(n))
# Judge status: Accepted
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

W, a, b = MAP()
if a <= b <= a+W or a <= b+W <= a+W:
	print(0)
else:
	print(min(abs(a+W-b), abs(a-b-W)))
# Judge status: Accepted
h = int(input())
fix = 1

while h >= fix:
  fix *= 2

print(fix - 1)
# Judge status: Wrong Answer
N, A, B = input().split(' ')
N = int(N)
A = int(A)
B = int(B)
S = []
S = list(input())
JS = 0
AS = 0
OT = 0

for i in range(N):
  if S[i] == 'a':
    JS += 1
  elif S[i] == 'b':
    AS += 1
  elif S[i] == 'c':
    OT += 1
  
  if S[i] == 'a' and A + B >= (JS + AS):
    print('Yes')
  elif S[i] == 'b' and A + B >= (JS + AS) and AS <= B:
    print('Yes')
  else:
    print('No')
# Judge status: Wrong Answer
# Problem C - Bugged

# input
N = int(input())

# initialization
max_score = 0
score_list = []
for i in range(N):
    tmp = int(input())
    score_list.append(tmp)
score_list = sorted(score_list, reverse=True)

# score update
min_score = 10**4 + 1
for score in score_list:
    max_score += score
    if tmp%10!=0 and min_score>score:
        min_score = score

# output
ans = 0
if max_score%10==0:
    ans = max(0, max_score-min_score)
print(ans)
# Judge status: Accepted
K,S = map(int,input().split())
ans = 0
for x in range(K+1):
    for y in range(K+1):
        z = S - (x + y)
        if  0 <= z <= K:
            ans += 1
print(ans)
# Judge status: Wrong Answer
a, b = map(int, input().split())

if a * b > 81:
    print(-1)
else:
    print(a*b)
# Judge status: Accepted
A, B, C = map(int, input().split())
print('No' if A + B < C else 'Yes')
# Judge status: Accepted
N, K = map(int, input().split())
print((N + K) % 24)
# Judge status: Accepted
import math
n = int(input())
flag = False

for i in range(1,n+1000):
    if math.floor(i*1.08) == n:
        flag = True
        ans = i
        break

if flag:
    print(ans)
else:
    print(":(")
# Judge status: Accepted
import bisect
N, M, K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
S = [0]*N
T = [0]*M
S[0] = A[0]
for k in range(1,N):
    S[k] = S[k-1] + A[k]
T[0] = B[0]
for k in range(1,M):
    T[k] = T[k-1] + B[k]

ans = bisect.bisect_right(T,K)
for k in range(N):
    if K-S[k] >= 0:
        ans = max(ans,k+1+bisect.bisect_right(T,K-S[k]))
print(ans)
# Judge status: Accepted
S,W = map(int,input().split())
if S <= W:
    print('unsafe')
else:
    print('safe')
# Judge status: Accepted
A,B,C,D = map(int,list(input()))

dic = { 1:"+" , -1:"-"}

import itertools
for AB,BC,CD in itertools.product([1,-1],repeat=3):
    tmp = A + B*AB + C*BC + D*CD

    if tmp ==7:
        ans = str(A)+dic[AB]+str(B)+dic[BC]+str(C)+dic[CD]+str(D)+"=7"
        print(ans)
        exit()
# Judge status: Accepted
n = int(input())
v = list(map(int,input().split()))
for i in range(n-1):v.sort();v.append((v[0]+v[1])/2);del v[:2]
print(v[0])
# Judge status: Wrong Answer
import numpy
N,M,X = map(int,input().split())
A = numpy.array([[int(i) for i in input().split()] for _ in range(N)])
ans = 10**6
for i in range(2**N) :
    i = format(i,'b').zfill(N)
    s = 0
    check = numpy.array([0]*(M+1))
    for j in range(N) :
        if i[j] == '0' :
            continue
        check +=  A[j][0:]
    if all (check[m] >= X for m in range(1,M+1)) :
        ans = min(ans,check[0])

if ans == 10**6 :
    print(-1)
else :
    print(ans)
# Judge status: Accepted
n, a, b = map(int, input().split())
s = input()

a_reviewed = 0
b_reviewed = 0

for x in s:
    if a_reviewed + b_reviewed < a + b:
        if x == 'a':
            print('Yes')
            a_reviewed += 1
        elif x == 'b' and b_reviewed < b:
            print('Yes')
            b_reviewed += 1
        else:
            print('No')
    else:
        print('No')
# Judge status: Wrong Answer
N = int(input())
cnt = 0
tmp = 0
for i in range(N):
    a = int(input())
    cnt += a//2
    tmp2 = a%2
    if tmp2*tmp:
        cnt +=1
        tmp = 0
    else:
        tmp = tmp2
print(cnt)
# Judge status: Accepted
n, m, k = map(int, input().split())
an = list(map(int, input().split()))
bn = list(map(int, input().split()))

a_sum = [0]
b_sum = [0]
for i in range(1, n+1):
  a_sum.append(a_sum[i-1] + an[i-1])
for j in range(1, m+1):
  b_sum.append(b_sum[j-1] + bn[j-1])

idx = len(bn)
ans = 0
for i in range(n+1):
  while a_sum[i] + b_sum[idx] > k:
    idx -= 1
    if idx == -1:
      break
  if idx == -1:
    break
  ans = max(ans, i + idx)

print(ans)
# Judge status: Accepted
a = input()
print('A' if a.isupper() else 'a')
# Judge status: Accepted
a, b = input().split()

if a<b :
    print(a*int(b))
else:
    print(b*int(a))
# Judge status: Wrong Answer
a=list(map(int,input().split()))
a.sort()
if a[0] == a[1] and a[1] == a[2] and a[0] == a[2]:
  print("No")
else:
  print("Yes")
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-

n = int(input())
k = int(input())
x = int(input())
y = int(input())

print((k * x) + ((n - k) * y if (n - k) >= 0 else 0))
# Judge status: Wrong Answer
n = int(input())
l = list(map(int, input().split()))
ans = 0
l.sort(reverse = True)

print(l)


for i in range(n):
    for j in range(n):
        for k in range(n):
            if l[i] == l[j] or l[i] == l[k] or l[j] == l[k]:
                continue
            elif l[i] < l[j] + l[k]:
                ans += 1

print(ans // 6)
# Judge status: Accepted
H, W = map(int, input().split())

if H == 1 or W == 1:
  ans = 1
else:
  if (H*W)%2 == 0:
    ans = int((H*W)/2)
  else:
    ans = int((H*W+1)/2)
print(ans)
# Judge status: Accepted
k,x=map(int,input().split())
if(k*500>=x):
  print('Yes')
else:
  print('No')
# 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
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
x = a - b
if x < 0:
  x = -x
if v > w and (v - w) * t >= x:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
K = int(input())

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

possible = False

for i in range(A, B + 1):
  # print(i)
  if i % K == 0:
    possible = True

if possible:
  print("OK")
else:
  print("NG")
# Judge status: Accepted
N = int(input())
MOD = 10**9 + 7
A_s = list(map(int, input().split()))
ruiseki = [] 
for i, A in enumerate(A_s):
    if i == 0:
        ruiseki.append(A)
        continue
    ruiseki.append(ruiseki[i-1]+A)
answer = 0
for i, r in enumerate(ruiseki):
    answer += (A_s[i] * (ruiseki[N-1]-ruiseki[i]))
    answer %= MOD
print(answer)
# Judge status: Accepted
n,m,x = map(int, input().split())
c = [list(map(int, input().split())) for _ in range(n)]
ans = float("inf")
for i in range(1 << n):
    money = 0
    skill = [0]*m
    for j in range(n):
        if ((i >> j) & 1) == 1:
            money += c[j][0]
            for k in range(1,m+1):
                skill[k-1] += c[j][k]
    if all(l >= x for l in skill):
        ans = min(ans,money)
print(-1 if ans==float("inf") else ans)
# Judge status: Accepted
import bisect

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

a.sort()
m = 0
ans = []

for i in a:
    R = i / 2
    p = bisect.bisect_left(a,R)
    if p == 0:
        r = a[p]
    else:
        r = a[p] if abs(a[p] - R) < abs(a[p - 1] - R) else a[p - 1]
    if m < i + min(r,i - r):
        m = i + min(r,i - r)
        ans = [i,r]
print(*ans)
# Judge status: Accepted
n, l = map(int, input().split())
sl = []
for i in range(n):
    s = input()
    sl.append(s)
sl.sort()
#print(sl)
ans = ""
for i in range(n):
    ans += sl[i]
print(ans)
# Judge status: Accepted
L, R = map(int, input().split())

if R - L >= 2019:
    print(0)
    exit()

ans = 2019

for i in range(L, R+1):
    for j in range(i+1, R+1):
        ans = min(ans, (i*j)%2019)

print(ans)
# Judge status: Wrong Answer
import sys

def solve():
    input = sys.stdin.readline
    Q, H, S, D = map(int, input().split())
    N = int(input())
    Q *= 4
    H *= 2
    D /= 2
    if N % 2 == 0: print(int(min([Q, H, S, D]) * N))
    else:
        sub = int(min([Q, H, S, D]) * (N - 1))
        print(sub + min([Q, H, S]))

    return 0

if __name__ == "__main__":
    solve()
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))
ans = 0
m = 0
for i in range(n-1):
    if h[i] >= h[i+1]:
        m += 1
        ans = max(ans, m)
    else:
        ans = max(ans, m)
        m = 0
print(ans)
# Judge status: Accepted
N, T = map(int, input().split())
routes = [tuple(map(int, input().split())) for _ in range(N)]
ans = [c for c, t in routes if t <= T]
if len(ans):
    print(min(ans))
else:
    print("TLE")
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

B = [i-A[i] for i in range(N)]
C = [i+A[i] for i in range(N)]

B.sort()
C.sort()

j = 0
ct = 0
cashe = 0
for i in range(N):
  if i >= 1 and B[i-1] == B[i]:
    ct += cashe
  else:
    cashe = 0
    while C[j] <= B[i]:
      if C[j] == B[i]:
        ct += 1
        cashe += 1
      j += 1
      
print(ct)
# Judge status: Wrong Answer
a,b = map(int, input().split())

def gcd(a,b):
  m,n = max(a,b),min(a,b)
  r = n
  while r > 0:
    n = r
    r = m%n
    m = n
  return n

def factorization(n):
  arr = {1}
  tmp = n
  for i in range(2,int(-(-10**0.5//1))):
    if tmp%i == 0:
      arr.add(i)
      while tmp%i == 0:
        tmp //= i
  if tmp != 1:
    arr.add(tmp)
  if arr == []:
    arr.add(n)
  return arr

g = gcd(a,b)
arr = factorization(g)
print(len(arr))
# Judge status: Accepted
n,k = map(int, input().split())

ans = 0
for i in range(1,n+1):
  t = 0
  while i < k:
    i *= 2
    t += 1
  ans += 0.5**t
print(ans/n)
# Judge status: Accepted
A = int(input())
B = int(input())
C = int(input())
X = int(input())

case = 0
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            if a*500 + b * 100 + c * 50 == X:
                case+=1
print(case)
# Judge status: Accepted
mod=pow(10,9)+7
n,k=map(int,input().split())
mini,maxi=-1,-1
ranges=[[0,0]]
ans=0
for i in range(k,n+2):
    mini=(i*(i-1))//2
    maxi=((i)*(n+n-i+1))//2
    ans += (maxi-mini+1)%mod
    ans=ans%mod

print(ans)
# Judge status: Accepted
N, M, K = map(int, input().split())
A = [0]+list(map(int, input().split()))
B = [0]+list(map(int, input().split()))
import itertools
A_cs = list(itertools.accumulate(A))
B_cs = list(itertools.accumulate(B))

total = 0
j = len(B)-1
for i in range(len(A_cs)):
    while (j >= 0):
        if A_cs[i] + B_cs[j] <= K:
                total = max(total,i + j)
                break
        j -= 1

print(total)
# Judge status: Accepted
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N = int(readline())
    
    
    for n in range(N, 0, -1):
        m = n
        while m % 2 == 0:
            m //= 2
        if m == 1:
            ans = n
            break
        
    print(ans)
    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
N,M=map(int,input().split())
print(1 if N==1 and M==1 else max(N,M)-2 if N==1 or M==1 else N*M-2*N-2*M+4)
# Judge status: Accepted
h = int(input())
w = int(input())
n = int(input())

write = 0
result = 0

while write < n:
    if w > h:
        write += w
        h -= 1
    else:
        write += h
        w -= 1
    result += 1

print(result)
# Judge status: Accepted
a,v=(int(x) for x in input().split())
b,w=(int(x) for x in input().split())
t = int(input())
 
distance = abs(a-b)
sa = v - w
 
if distance <= t*sa:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
a,b=map(int,input().split())
if a<=8 and b<=8:
    print("Yay!")
else:
    print(":(")
# Judge status: Accepted
N = int(input())
if N % 9 == 0:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n=int(input())
a = list(map(int,input().split()))

ans = 10**7
for i in range(102):
    p = 0
    m = 0
    for j, aa in enumerate(a):
        p += (aa-i)**2
        m += (aa+i)**2
    ans = min(ans,p,m)

print(ans)
# Judge status: Accepted
S = input()

if len(S)%2==0 and S=='hi'*(len(S)//2):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n = int(input())
if n < 1000:
    print('ABC')
else:
    print('ABD')
# Judge status: Accepted
n = int(input())
s = input()
t = input()
num = 0
for i in range(1, n+1):
    if s[-i:] == t[:i]:
        num = i

print(n*2 - num)
# Judge status: Accepted
import sys


def LI():
    return list(map(int, input().split()))


A, B = LI()
S = input()
ans = "Yes"
for i in range(A):
    if S[i] == "-":
        ans = "No"
        break
if S[A] != "-":
    ans = "No"
for i in range(A+1, A+B+1):
    if S[i] == "-":
        ans = "No"
        break
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
x = max(a)
half = x/2
y = sorted([ai for ai in a if ai < x], key=lambda x: abs(half-x))[0]
print("{} {}".format(x,y))
# Judge status: Accepted
N = int(input())

def judge(N):
    for i in range(1, 10):
        for j in range(1, 10):
            if i * j == N:
                return "Yes"
    return "No"

print(judge(N))
# Judge status: Accepted
S=input()
A=S.index("A")
Z=S[::-1].index("Z")
print(len(S)-(A+Z))
# Judge status: Accepted
N,D=map(int,input().split())
X=[]
Y=[]
for i in range(N):
    x,y=map(int,input().split())
    X.append(x)
    Y.append(y)
ans=0    
for i in range(N):
    if X[i]**2+Y[i]**2 <= D**2:
        ans += 1

print(ans)
# Judge status: Accepted
N,x = map(int, input().split())
a = list(map(int, input().split()))

a.sort()

A = sum(a)
if x > A:
  print(N-1)

else:
  cnt = 0
  for i in range(N):
    if x >= a[i]:
      x -=a[i]
      cnt += 1
  print(cnt)
# Judge status: Wrong Answer
N = int(input())
A = [(i+1, int(input())) for i in range(N)]
cnt = 1
for i in range(N):
  if 2 not in A[i]:
    print(-1)
    exit()
    
x = A[0]
while x[1] != 2:  
  
  x = A[x[1]-1]
  cnt += 1
  if x[1] == 1:
    print(-1)
    exit()
print(cnt+1)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
ans=0
for i in range(min(A),max(A)):
  tmp = 0
  for a in A:
    if a-1<=i<=a+1:
      tmp+=1
  ans = max(ans, tmp)
    
print(ans)
# Judge status: Wrong Answer
n,c,k=map(int,input().split())
T=[int(input()) for i in range(n)]

i=0
ans=0
T.sort()
while(i<n):
    time=T[i]+k
    i+=1
    ans+=1

    x=0
    while(x<c and i+x<n):
        if T[i+x]<=time:
            i+=1
        x+=1

print(ans)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

money = 1000

for i in range(1,   n-1):
    s = 0
    if a[i] < a[i + 1]:
        s = money // a[i]
    money += (a[i + 1] - a[i]) * s
print(money)
# Judge status: Accepted
n, m = map(int, input().split())
ab = []
for i in range(n):
    ai, bi = map(int, input().split())
    ab.append([ai, bi])
cd = []
for i in range(m):
    ci, di = map(int, input().split())
    cd.append([ci, di])

ans = []
for i in range(n):
    ai, bi = ab[i]
    mini = 10**10
    for j in range(m):
        cj, dj = cd[j]
        dist = abs(ai-cj) + abs(bi-dj)
        if dist < mini:
            mini = dist
            ret = j+1
    ans.append(ret)

for ret in ans:
    print(ret)
# Judge status: Wrong Answer
s=input()
if s=="ABC":
    print("ARC")
else:
    print("ARC")
# Judge status: Accepted
from math import *

n = input()
ha = False
for i in n:
    if i == '7':
        ha = True
        break


if ha:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
A, B = map(int, input().split())
if A <= 5:
  print(0)
elif 6 <= A <= 12 :
  print(int(B / 2))
else :
  print(B)
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))
cnt = ans = 0

for i in range(1, N):
  if H[i-1] < H[i]:
    ans = max(ans, cnt)
    cnt = 0
  elif H[i-1] >= H[i]:
    cnt += 1

print(max(ans, cnt))
# Judge status: Wrong Answer
a,b = list(map(int,input().split()))
if a % (b *2)== 0:
  print(a//(b*2))
else:
  print(a//(b*2)+1)
# Judge status: Accepted
from fractions import gcd
n, m = map(int, input().split())
a = [i//2 for i in map(int, input().split())]
z = []
for i in a:
    n = 0
    while i%2==0:
        i //= 2
        n += 1
    z.append(n)
if all(z[0]==i for i in z):
    x = 1
    for i in a:
        x = (x*i)//gcd(x, i)
    result = -(-(m//x)//2)
    print(result)
else:
    print(0)
# Judge status: Wrong Answer
x = int (input("Enter a value for x that is greater than or equal to 0 and less than or equal to 1: "))
if x == 0:
  print ("1")
elif x== 1:
  print ("0")
elif x>1 or x<0:
  print(x)
# Judge status: Accepted
N = int(input())
S = input()
for c in S:
    print(chr(ord(c) + N) if ord(c) + N <= 90 else chr(ord(c) + N - 26), end='')
print()
# Judge status: Accepted
from itertools import permutations
import math

N = int(input())
A = []
for i in range(N):
    A.append(list(map(int,input().split())))
#print(A)

B = []
for i in permutations(A,2):
    B.append(i)
#print(B)

ans = 0
for i in range(len(B)):
    ans += math.sqrt((B[i][0][0] - B[i][1][0])**2 + (B[i][0][1] - B[i][1][1])**2)

print(ans/N)
# Judge status: Wrong Answer
# coding:utf-8
n, k = map(int, input().split())
h = [int(input()) for _ in range(n)]
h.sort()
ans = h[0]

for i in range(0, n - k + 1):
    ans = min(ans, h[i + k - 1] - h[i])

print(ans)
# Judge status: Accepted
n=int(input())
c=input()
r=c.count("R")
r_1=c[:r].count("R")
ans=r-r_1
print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
X = list(map(int, input().split()))

ans = 10**18
for i in range(N - K + 1):
    x1 = X[i]
    x2 = X[i + K - 1]
    if x1 * x2 >= 0:
        dist = max(abs(x1), abs(x2))
    else:
        dist = min(abs(x1), abs(x2)) + abs(x1 - x2)
    ans = min(ans, dist)
print(ans)
# Judge status: Accepted
A, B = map(int, input().split())

AB = A + B
if AB >= 24:
    print(AB - 24)
else:
    print(AB)
# Judge status: Accepted
a, b = list(map(int, input().split()))
if a <= b:
  my_result = a
else:
  my_result = a - 1
print(my_result)
# Judge status: Wrong Answer
s = input()
k = int(input())
if k == 1: print(s[0])
elif s[0] == "1": print(s[1])
else: print(s[0])
# Judge status: Accepted
s=input()
t=input()
a=0
for i in range(len(s)):
  if s[i]!=t[i]:
    a+=1
print(a)
# Judge status: Accepted
k,s=map(int,input().split())
ans=0
for i in range(k+1):
  for j in range(k+1):
    if 0<=s-i-j<=k:
      ans+=1
print(ans)
# Judge status: Accepted
n = int(input())
a = [int(num) for num in input().split()]
ans = 1
if 0 in a:
    ans = 0
for i in range(n):
    ans *= a[i]
    if ans > 10 ** 18:
        ans = -1
        break
        
print(ans)
# Judge status: Accepted
from itertools import accumulate
N, K = map(int, input().split())
A = [int(i) for i in input().split()]

for _ in range(K):
    S = [0] * (N + 1)
    for i, a in enumerate(A):
        l = min(N-1, max(0, i-a))
        r = min(N-1, i+a)
        S[l] += 1
        S[r+1] -= 1
    A = list(accumulate(S))[:-1]
    if all([a == N for a in A]):
        break
print(*A)
# Judge status: Accepted
A, B, C = map(int, input().split())
if A % 2 == 0 or B % 2 == 0 or C % 2 == 0:
    print(0)
else:
    print(min(abs((A//2)*B*C-((A//2)+1)*B*C),abs((B//2)*A*C-((B//2)+1)*A*C),abs((C//2)*B*A-((C//2)+1)*B*A)))
# Judge status: Accepted
def main():
    x = int(input())

    ele = x // 11
    answer = 2 * ele

    if x % 11 != 0:
        x -= 11 * ele
        answer = 2 * ele

        if x <= 6:
            answer += 1
        else:
            answer += 2

    print(answer)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
c = input()
vowel = ['a','i','u','e,','o']
if c in vowel:
    print('vowel')
else:
    print('consonant')
# Judge status: Wrong Answer
n = int(input())
from collections import defaultdict
a = list(map(int,input().split()))
ans = 0
dp = defaultdict(int)
for e,i in enumerate(a,1):
    ans += dp[i-e]
    dp[i+e]+=1
print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())
if a + b >= c:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
s = input()
check = s.count("R")
q = s[:check]
print(q.count("W"))
# Judge status: Accepted
A = int(input())
print(800*A-200*(A//15))
# Judge status: Accepted
N = int(input())
S = input()
l = [0]
x = 0
for i in range(N):
    if S[i] == "I":
        x+=1
    else:
        x-=1
    l.append(x)
print(max(l))
# Judge status: Accepted
def main():
    import fractions
    from functools import reduce

    n, x, *l = map(int, open(0).read().split())
    a = list(map(lambda i: abs(i-x), l))
    ans = reduce(fractions.gcd, a)
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
n, r = map(int, input().split())

if n <= 10:
    print(r+100*(10-n))
elif n > 10:
    print(r)
# Judge status: Wrong Answer
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

import math

n = ni()

divs=[]

for i in range(2,math.ceil(math.sqrt(n))+1):
  while n%i==0:
    divs.append(i)
    n//=i

if len(divs)==0:
  divs.append(n)

last=0

total=0

cnt=0
tmp_cnt=0
for d in divs:
  if last!=d:
    last=d
    cnt=0
    tmp_cnt=0
  if cnt==tmp_cnt:
    total+=1
    cnt+=1
    tmp_cnt=0
  else:
    tmp_cnt+=1

print(total)
# print(divs)
# Judge status: Accepted
a, b, c = map(int, input().split())
k = int(input())
rem = sum((a, b, c)) - max(a, b, c)
print(max(a, b, c)*2**k + rem)
# Judge status: Accepted
print(["Yes","No"][input().count("2")])
# Judge status: Accepted
from collections import defaultdict
def factorize(M):
  res=defaultdict(int)
  for i in range(2,int(M**0.5)+1):
    if M==1:
      break
    while M%i==0:
      M//=i
      res[i]+=1  
  if M!=1:
    res[M]=1
  return res

N=int(input())
fact=factorize(N)
#print(fact)

def times(n):
  ret=1
  for i in range(2,10**9):
    if n<i*(i+1)//2:
      return ret
    else:
      ret+=1

answer=0
for v in fact.values():  
  #print(v,times(v))
  answer+=times(v)
  
print(answer)
# Judge status: Accepted
n = input()

if n[-1]=='3':
    print('bon')
elif n[-1] == '0' or n[-1]=='1' or n[-1]=='6' or n[-1]=='8':
    print('pon')
else:
    print('hon')
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

cnt=0
ans=0

for i in range(n):
    if a[i]<0:
        cnt+=1
        a[i]*=-1



if cnt%2==0:
    ans=sum(a)

else:
    ans=sum(a)-2*min(a)

print(ans)
# Judge status: Accepted
import heapq

N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(M)]

heapq.heapify(A)

BC = sorted(BC, key = lambda x : x[1], reverse=True)
for b, c in BC:
    for i in range(b):
        a = heapq.heappop(A)
        if a < c:
            heapq.heappush(A, c)
        else:
            heapq.heappush(A, a)
            break

print(sum(A))