peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
def countDivisibles(A, B, M): 
    if (A % M == 0): 
        return ((B / M) - (A / M)) + 1
    return ((B / M) - (A / M))

l,r,d = [int(x) for x in input().split()]
print(countDivisibles(l,r,d))
# Judge status: Wrong Answer
N=input()
if N==set(N):
    print("yes")
else:
    print("no")
# Judge status: Accepted
import copy
N, K = map(int, input().split())
A = list(map(int, input().split()))
lights = [0] * N

for _ in range(min(K, 42)):
    lights = [0] * N
    for i, flash in enumerate(A):
        lights[max(0, i-flash)] += 1
        if i+flash < N-1:
            lights[i+flash+1] -= 1
    for i in range(1, N):
        lights[i] += lights[i-1]
    A = copy.deepcopy(lights)

for i in A:
    print(int(i),end=' ')
print()
# Judge status: Accepted
N = int(input())
A = [0 for _ in range(N)]
for i in range(N-1):
  c, s, f = map(int, input().split())
  for j in range(i+1):
    if A[j] < s:
      A[j] = s + c
    else:
      d = (A[j] - s) // f
      if (A[j] - s) % f != 0:
        d += 1
      A[j] = s + f * d + c
for i in range(N):
  print(A[i])
# Judge status: Wrong Answer
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))

a_meter = (12-A*1000)//6

ans = -1
diff = 10**9
for i in range(N):
    d = abs(1000*T-6*H[i]-1000*A)
    if d < diff:
        d = diff
        ans = i + 1
print(ans)
# Judge status: Accepted
s=''.join(sorted(input()))
if s=='abc':
    print('Yes')
else:
    print('No')
# Judge status: Accepted
from itertools import groupby

n = input()
li = list(map(int, input().split()))
lii = [val == (itr + 1) for itr, val in enumerate(li)]
gbli = [[key, len(list(group))] for key, group in groupby(lii)]
 
ans = 0
for key, val in gbli:
  if key:
    ans += (val - 1) // 2 + 1
    
print(ans)
# Judge status: Accepted
def comb_mod(n,r,m):
    ans = 1
    for i in range(1,r+1):
        ans *= (n-i+1) % m
        ans *= pow(i,m-2,m) % m
        ans = ans % m
    return ans
x,y = map(int,input().split())
m = 10**9+7
n = (x+y)//3
c = 0
if x*0.5 <= y <= 2*x and (x+y)%3 == 0:
    r = x - n
    c = comb_mod(n,r,m)
else:
    ans = 0
print(c)
# Judge status: Wrong Answer
print('YES' if len(set(input())) == 3 else 'No')
# Judge status: Accepted
n=int(input())
d=list(map(int,input().split()))
if d[0] != 0:
    print(0)
    exit()
d.sort()
if d[1] == 0:
    print(0)
    exit()
cnt = 1
pre = 1
ans =1
i = 1
mod = 998244353
while i < n:
    if d[i]-1 != d[i-1]:
        ans = 0
    while i!=n-1 and d[i+1] == d[i]:
        i+=1
        cnt+=1
    ans *= pow(pre,cnt,mod)
    ans %= mod
    pre =cnt
    cnt = 1
    i+=1
print(ans)
# Judge status: Accepted
def count_0(n):
    if n%2 == 1:
        return 0
    div_10 = n//10
    sum = div_10
    for i in range(1, 50):
        sum += div_10//(5**i)
    return sum
N = int(input())
print(count_0(N))
# Judge status: Accepted
N=int(input())
P=list(map(int,input().split()))
min_p=P[0]
cnt=0
for i in range(N):
    if min_p>=P[i]:
        min_p=P[i]
        cnt+=1
print(cnt)
# Judge status: Wrong Answer
s = input()
count=0
for i in range(3):
    if s[i]==s[i+1]:
        count+=1
    else:
        count==0
    
    if count==2:
        print("Yes")
        exit()
print("No")
# Judge status: Wrong Answer
N,M = map(int,input().split())
A = list(map(int,input().split()))

def vote(a,m):
  a.sort(reverse=True)
  for i in range(m):
    if a[i] >= sum(a)/(4*m):
      return True
    else:
      return False
    
ans = "Yes" if vote(A,M) else "No"
print(ans)
# Judge status: Wrong Answer
#coding: utf-8
import math
import heapq
import bisect
import numpy as np
from collections import Counter
#from scipy.misc import comb

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

# 複数個の数値を、intの配列として取得
X = list(map(int, input().split()))

ans = 2*(10**8)
for i in range(N-K+1):
    tmp = min(abs(X[i])+abs(X[i+K-1]-X[i]), abs(X[i+K-1])*abs(X[i+K-1]-X[i]))
    ans = min(ans,tmp)

print(ans)
# Judge status: Accepted
bitsum = 0
ans = []
N = int(input())
num = list(int(x) for x in input().split())
for i in num:
    bitsum = bitsum ^ i
for i in num:
    ans.append(bitsum ^ i)
print(' '.join(map(str, ans)))
# Judge status: Accepted
N = int(input())
A = [int(x) for x in input().split()]
ans = sum(A)
l = [0] * 100000
for i in A:
    l[i-1] += 1
Q = int(input())
for i in range(Q):
    B, C = map(int, input().split())
    ans += l[B-1] * (C - B)
    l[C-1] += l[B-1]
    l[B-1] = 0
    print(ans)
# 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())
T = [[0, 0, 0]] + [list(map(int, input().split())) for _ in range(N)]
normal = True
def judge(a, b):
  m = b[0]-a[0]-abs(b[1]-a[1])-abs(b[2]-a[2])
  if m>=0 and m%2==0:
    return True
  else:
    return False
for i in range(N):
  if judge(T[i], T[i+1]):
    pass
  else:
    normal = False
    break
print("Yes" if normal else "No")
# Judge status: Wrong Answer
n = int(input())
C = input()
chk = 0
for i in range(n):
    if C[n-1-i] == 'R':
        chk = n-1-i
        break
cnt = 1
for i in range(chk):
    if C[i] == 'R':
        cnt += 1
ans = 0
for i in range(cnt):
    if C[i] == 'W':
        ans += 1
print(ans)
# Judge status: Wrong Answer
#!/usr/bin/env python3
from collections import defaultdict

w = input()
d = defaultdict(int)
for i in w:
    d[w] += 1
print("YNeos"[any(i % 2 > 0 for i in d.values())::2])
# Judge status: Accepted
from collections import deque
S=list(map(lambda x: 1 if x=="T" else 0,input()))

q=deque()

for i in S:

    if i:
        if (not q) or q[-1]!=0:
            q.append(i)
        elif q and q[-1]==0:
            q.pop()
    else:
        q.append(i)
print(len(q))
# Judge status: Accepted
import math 
x = int(input())
Su = math.floor(x/11)
M = x%11
if x < 11:
    if x <=6:
        print(1)
    else:
        print(2)
else:
    if M ==0:
        print(Su*2)
    else:
        if M <= 6:
            print(Su*2+1)
        else:
            print(Su*2+2)
# Judge status: Wrong Answer
n, a, b = map(int, input().split())
if a == 0:
    print(0)
elif a+b >= n:
    print(a) if a <= n else print(n)
else:
    ab = a + b
    ans = n // ab * a + n % ab
    print(ans)
# Judge status: Wrong Answer

def fn(i):
    return (1 <= i and i <= 9) or (100 <= i and i <= 999) or (10000 <= i and i <= 99999)


def main():
    # n = int(input())
    n = 124
    x = range(n + 1)[1:]
    x = tuple(filter(fn, x))

    print(len(x))


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

mxscore = -1
beststr = ''
for i in range(len(s),len(t)+1):
    check = t[i-len(s):i]
    now = 0
    for j in range(len(check)):
        if s[j] == check[j]:
            now += 1
    if now > mxscore:
        mxscore = now

print(len(s)-mxscore)
# Judge status: Accepted
N, M = map(int, input().split())
height = list(map(int, input().split()))
judge = N*[1]
for i in range(M):
	A, B = map(int, input().split())
	if(height[A-1]>=height[B-1]):
		judge[B-1] = 0
	if(height[A-1]<=height[B-1]):
		judge[A-1] = 0

ans = 0
for i in range(N):
	if judge[i]==1:
		ans += 1
print(ans)
# Judge status: Wrong Answer
S = input()
N = len(S)
a = S[0:(N-1)//2]
b = S[(N+3)//2-1:]

def kaibun(l):
    for i in range(len(l)):
        if l[i] != l[len(l)-1-i]:
            return(False)
    return(True)

print(kaibun(S))
print(a)
print(kaibun(a))
print(b)
print(kaibun(b))
  
if kaibun(S) & kaibun(a) & kaibun(b):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b,m = map(int,input().split())
price_a = list(map(int,input().split()))
price_b = list(map(int,input().split()))

minPrice = min(price_a) + min(price_b)

for i in range(m):
	x,y,c = map(int,input().split())
	price = price_a[x-1] + price_b[y-1] -c
	if price < minPrice:
		minPrice = price

print(minPrice)
# Judge status: Accepted
a,b,c = map(int,input().split())
if any(a*i%b==c for i in range(1,b)):
  print('YES')
else:
  print('NO')
# Judge status: Accepted
N = int(input())
A = map(int, input().split())
var0 = 0
var1 = 0
var2 = 0

for a in A:
    if a % 4 == 0:
        var2 += 1
    elif a % 2 == 0:
        var1 += 1
    else:
        var0 += 1

var1 %= 2
ans = 'Yes' if var2 >= var1 + var0 - 1 else 'No'
print(ans)
# Judge status: Accepted
n = int(input())
a_li = list(map(int,input().split()))
a_li.sort()
ans = 0
for i in range(1,n+1):
    ans += a_li[3*n-1-(i*2-1)]
print(ans)
# Judge status: Wrong Answer
h1, m1, h2, m2, k = map(int,input().split())
x = 60*max(0, h2-h1-1)
x += (60-m1 + m2)
if x%k == 0:
    print((x//k - 1)*k)
else:
    print((x//k)*k)
# Judge status: Accepted
N,K = map(int,input().split())
A = list(map(int,input().split()))
s = 1
B = []
set_ = set()
for i in range(N):
    if A[s-1] not in set_:
        set_.add(A[s-1])
        B.append(A[s-1])
        s = A[s-1]
        
    else:
        e = i
        break
idx = B.index(A[s-1])
if K-1<idx: print(B[K-1])
else:
    print(B[idx + (K-idx-1)%(e-idx)])
# Judge status: Accepted
p = 2019
s = input()
n = len(s)
M = [0]*(p)
M[0] = 1
m = 0
d = 1

for i in range(n):
  m = (m + int(s[-i-1])*d ) % p  
  M[m] += 1
  d = (d*10) % p
  
ans = 0  
for m in M:
  if m>=2:
    ans += m*(m-1)//2
    
print(ans)
# Judge status: Accepted
n = int(input())
l = [int(i) for i in input().split()]
ans = 0
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if l[i] == l[j] or l[j] == l[k] or l[k] == l[i]: continue
            if l[i] >= l[j] + l[k]: continue
            if l[j] >= l[i] + l[k]: continue
            if l[k] >= l[i] + l[j]: continue
            ans += 1
print(ans)
# Judge status: Accepted
n,k=map(int,input().split())

if n%k<=abs(n%k-k):
    print(n%k)
else:
    print(abs(n%k-k))
# Judge status: Wrong Answer
# ABC 054: B – Template Matching
n, m = map(int, input().split())
a = [input() for _ in range(n)]
b = [input() for _ in range(m)]

isIncluding = 'No'

for p in a:
    for q in b:
        if q not in p:
            break
    else:
        isIncluding = 'Yes'
        break
        
print(isIncluding)
# Judge status: Accepted
n=int(input())
dp=[[0]*3 for _ in range(n)]
dp[0]=list(map(int,input().split()))
for i in range(1,n):
    a,b,c=map(int,input().split())
    dp[i][0]=a+max(dp[i-1][1],dp[i-1][2])
    dp[i][1]=b+max(dp[i-1][0],dp[i-1][2])
    dp[i][2]=c+max(dp[i-1][0],dp[i-1][1])
print(max(dp[n-1]))
# Judge status: Accepted
n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))

m=float('inf')
for i in range(n):
  if abs(a-t+0.006*H[i])<m:
    m=abs(a-t+0.006*H[i])
    ans=i
print(ans+1)
# Judge status: Accepted
s = str(input())
ans = "x" *  len(s)
print(ans)
# Judge status: Accepted
import re
s=input()

rs = [len(x) for x in re.findall("R{1,}", s)]

if rs == []:
    print(0)
else:
    print(max(rs))
# Judge status: Accepted
# 入力 : 数字3つ
A, B, C = map(int, input().split())

if (A+B) >= C :
    print("Yes")
else :
    print("No")
# Judge status: Accepted
#!/usr/bin/env python3
import heapq
# import bisect

n, m = list(map(int, input().split()))
a = list(map(lambda x: int(x)*(-1), input().split()))

heapq.heapify(a)
for i in range(m):
    value = heapq.heappop(a)
    value = (value+1)//2
    heapq.heappush(a, value)

# print(a)
print(-sum(a))
# Judge status: Accepted
n, m = map(int, input().split())
graph = list(input())
ans = [0] * n
sans = [0] * n
for i in range(n-1):
    if graph[i] == "A" and graph[i+1] == "C":
        ans[i] += 1
for j in range(n-1):
    sans[j+1] = sans[j] + ans[j]

for _ in range(m):
    j, k = map(int, input().split())
    print(sans[k-1] - sans[j-1])
# Judge status: Accepted
(N,K) = map(int,input().split())
l = input().split()
max = 0
for i in range(N):
    l[i]= int(l[i])
    if max <= l[i]:
        max = l[i]

lb = 0
ub = max

def cut(m):
    k = 0
    for i in range(N):
        k += -((-1*l[i])//m)-1
    return k

while ub - lb > 1:
    if cut((ub+lb)//2)>K:
        lb = (ub+lb)//2
    else:
        ub = (ub+lb)//2

print(ub)
# Judge status: Wrong Answer
N = int(input())
print(N//2+1)
# Judge status: Accepted
K, N = map(int, input().split())
A_i = list(map(int, input().split()))


# 20 3 20メートルで3件の家
# 0 5 15

# [5, 10] + [0 + (20 -15)]
# [5, 10, 5]
# max([5, 10, 5]) => 10
# 20 - 10

D_i = []
D_i.append(A_i[0] + K - A_i[-1])


for i in range(N-1):
    D_i.append(A_i[i+1] - A_i[i])

print(K - max(D_i))
# Judge status: Accepted
H = int(input())
W = int(input())
N = int(input())
print((N + max(H, W) - 1) // max(H, W))
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
counter=1
res=0
for i in range(len(A)-1):
    if (A[i+1]<A[i] and res>0) or (A[i+1]>A[i] and res<0):
        counter+=1
        res=0
    elif A[i+1]!=A[i]:
        res=A[i+1]-A[i]


print(counter)
# Judge status: Wrong Answer
X,Y,Z = map(int,input().split())
cnt = 0

while (X-1) >= (Z+Y):
    X -= (Z+Y)
    cnt += 1
print(cnt)
# Judge status: Accepted
dic = {
  "Sunny":"Cloudy",
  "Cloudy":"Rainy",
  "Rainy":"Sunny"
}

print(dic[input()])
# Judge status: Accepted
a = int(input())
print (a + a ** 2 + a ** 3)
# Judge status: Wrong Answer
N, M = map(int, input().split())
AC = [0]*N
WA = [0]*N

for i in range(M):
    p, S = input().split()
    p = int(p) 

    if S == "AC":
        AC[p-1] = 1
    elif S == "WA":
        if not AC[p-1]:
            WA[p-1] = 1

for j in range(N):
    if AC[j]==0:
        WA[j]==0

print(sum(AC), sum(WA))
# Judge status: Wrong Answer
validation=False
Answer=()


while validation == False:
      R=float(input("Enter a number for the radius of the circle :"))
      if R>=1 and R<=100:
            validation = True
      else:
            break
      

Answer=((R*2)*3.14159)

print(Answer)
# Judge status: Accepted
n = int(input())
if n %1000 == 0:
  print(0)
else:
  print(1000-n%1000)
# Judge status: Accepted
import sys
stdin = sys.stdin
from collections import defaultdict

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))

n = ni()
d = defaultdict(int)
for _ in range(n):
    s = ns()
    d[s] += 1
d = sorted(d.items(), key = lambda x:x[1], reverse=True)
ki, vi = d[0]
k = [ki]
for ki, v in d[1:]:
    if v == vi:
        k.append(ki)
k.sort()
for ki in k:
    print(ki)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

import math
L = [0] * (N + 1)
R = [0] * (N + 1)

for i in range(N):
    L[i + 1] = math.gcd(L[i], A[i])
    R[N - i - 1] = math.gcd(R[N - i], A[N - i - 1])

ans = 0
for i in range(N):
    ans = max(ans, math.gcd(L[i], R[i+1]))

print(ans)
# Judge status: Wrong Answer
n = int(input())
a = 1

if n % 2 == 1:
    n -= 1

if n % 2 == 0:
    for i in range(int(n/2)):
        a = 2*a + 1

print(a)
# Judge status: Wrong Answer
#!/usr/bin/env python3
# input
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
D = int(input())
C = list(map(int, input().split()))
S = []
for i in range(D):
    a = list(map(int, input().split()))
    S.append(a)
for i in range(D):
    idx = 1
    tmp_max = 0
    for j in range(26):
        if tmp_max <= S[i][j]:
            tmp_max = S[i][j]
            idx = j + 1
            # print("a", idx)
    print(idx + 1)
# Judge status: Accepted
import decimal

a,b = map(str, input().split())

A=decimal.Decimal(a)
B=decimal.Decimal(b)

print(decimal.Decimal(A*B).quantize(decimal.Decimal('1.'), rounding=decimal.ROUND_DOWN))
# Judge status: Accepted
# -*- coding: utf-8 -*-
n = int(input())

flag = 0
for cake in range(100):
    for donuts in range(100):
        if 4 * cake + 7 * donuts == n:
            flag = 1

if flag == 1:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s=list(input())
s[3]=8
for i in s:
  print(i,end="")
# Judge status: Accepted
from itertools import combinations_with_replacement as comb

n, m, q = map(int, input().split())
queries = [tuple(map(int, input().split())) for _ in range(q)]
ans = 0

def calc_score(p):
    score = 0
    for a, b, c, d in queries:
        if p[b-1] - p[a-1] == c:
            score += d
    return score

for p in comb(range(1, m+1), n):
    ans = max(ans, calc_score(p))

print(ans)
# Judge status: Accepted
from fractions import gcd
n,m = map(int,input().split())
A = list(map(int,input().split()))

l = 1
cnt = -1
for a in A:
    l = l*a//gcd(l,a)
    i = 0
    while a%2 == 0:
        a = a//2
        i += 1
    if cnt == -1:
        cnt = i
    elif cnt != i:
        print(0)
        exit(0)

ans = 1 + (m - l//2)//l
print(ans)
# Judge status: Accepted
if ''.join(sorted(input())) == 'abc':
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n, m = map(int, input().split())
ball = [1]*n
flg = [False]*n
flg[0] = True

for _ in range(m):
    x, y = map(int, input().split())
    if flg[x-1]:
        flg[y-1] = True
    if ball[x-1] == 1 and flg[x-1]:
        flg[x-1] = False
    ball[y-1] += 1
    ball[x-1] -= 1
    # print(x, y, ball, flg)

ans = flg.count(True)
print(ans)
# Judge status: Wrong Answer
import itertools
n=int(input())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
nums = list(range(1,n+1))
d= [ list(i) for i in itertools.permutations(nums)]
a=0
b=0
for i in range(len(d)):
  if p==d[i]:
    a=i
  elif q==d[i]:
    b=i
print(abs(a-b))
# Judge status: Wrong Answer
n = int(input())
a_list = list(map(int, input().split()))
money = 1000
stock = 0
for i in range(n-1):
    if a_list[i+1] < a_list[i]:
        money += stock*a_list[i]
        stock = 0
    elif a_list[i+1] > a_list[i]:
        stock += money//a_list[i]
        money -= stock*a_list[i]

print(money+stock*a_list[n-1])
# Judge status: Accepted
n = int(input())
pos = []
for _ in range(n):
  x,y = map(int,input().split())
  pos.append((x,y))

import math
def distance(p1,p2):
  x1,y1 = p1
  x2,y2 = p2
  return math.sqrt((x1-x2)**2 + (y1-y2)**2)
  
ans = 0
for i in range(n):
  for j in range(n):
    ans += distance(pos[i],pos[j])
print(ans/n)
# Judge status: Accepted
n,k = map(int,input().split())
s = input()

ans = 0
for i in range(n-1):
    if s[i] == s[i+1]:
        ans += 1
        
print(min(ans + 2*k , n-1))
# Judge status: Accepted
import heapq

N, M = map(int, input().split())
A = list(map(lambda x: (-1)*int(x), input().split()))
heapq.heapify(A)

for _ in range(M):
  t_min = heapq.heappop(A)
  heapq.heappush(A, (-1)*(-t_min//2))
  
print(-sum(A))
# Judge status: Wrong Answer
S, W = list(map(int, input().split()))
if S < W:
    print("unsafe")
else:
    print("safe")
# Judge status: Accepted
n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n <= k: print(n * x)
else: print(k * x + (n-k) * y)
# Judge status: Accepted
S=input()
agct='AGCT'
ans=0
for i in range(len(S)):
  cnt=0
  j=i
  while j<len(S) and S[j] in agct :
    cnt+=1
    j+=1
  ans=max(ans,cnt)
print(ans)
# Judge status: Accepted
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    q,h,s,d=map(int,readline().split())
    n=int(readline())

    if n%2==0:
        print(min(4*q*n,2*h*n,s*n,d*n//2))
    else:
        tmp1=min(4*q*(n-1),2*h*(n-1),s*(n-1),d*(n-1)//2)
        tmp2=min(4*q,2*h,s)
        print(tmp1+tmp2)
        
if __name__=="__main__":
    main()
# Judge status: Accepted
N = int(input())
res = N * (N - 1) // 2
print(res)
# Judge status: Wrong Answer
import numpy as np

N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]

count = np.zeros(N)

for a in A:
    count[a-1] += 1

ans = K - (Q - count)

print(ans)

for answer in ans:
    if answer <= 0:
        print('No')
    else:
        print('Yes')
# Judge status: Accepted
a, b = map(int, input().split())
s = list(input())

flag1 = False
if s[a] == '-':
    flag1 = True

flag2 = False
if not '-' in s[:a - 1] and not '-' in s[a + 1:]:
    flag2 = True

if flag1 and flag2:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
C1 = str(input())
C2 = str(input())

if C1[0] == C2[-1] and C1[1] == C2[-2] and C1[2] == C2[-3]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
L, R, d = map(int, input().split())

ans = 0
for x in range(L, R+1):
  if x%d == 0:
    ans += 1
print(ans)
# Judge status: Wrong Answer
N, M = map(int, input().split())

if N-M == 0:
    print('AC')
else:
    print('WA')
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

ans = 0
for i in range(1, n - 1):
    if min(a[i - 1], a[i], a[i + 1]) != a[i] and max(a[i - 1], a[i], a[i + 1]) != a[i]:
        ans += 1
print(ans)
# Judge status: Accepted
import sys

def solve():
    input = sys.stdin.readline
    X = int(input())
    if 0 < X % 11 <= 6: print(((X - 1) // 11 + 1) * 2 - 1)
    else: print(((X - 1) // 11 + 1) * 2)

    return 0

if __name__ == "__main__":
    solve()
# Judge status: Accepted
n, m, k = map(int, input().split())

cant = True
for i in range(n+1):
    for j in range(m+1):
        if m*i+n*j-2*i*j==k: cant = False
print("YNeos"[cant::2])
# Judge status: Accepted
import numpy as np
n, q = map(int, input().split())
s = input()
ans = np.zeros(n, dtype=int)

for i in range(1, n):
    if s[i - 1:i + 1] == "AC":
        ans[i] = 1

ans = ans.cumsum()

result = []

for i in range(q):
    l, r = map(int, input().split())
    result.append(ans[r - 1] - ans[l - 1])

print(*result, sep="\n")
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))
visited = [0]*N #各場所に最初に到着するまでの移動回数
cnt = 0 #現在の移動回数
pos = 0 #現在の場所
flag = False
while K > 0:
    cnt += 1
    K -= 1
    if visited[pos] == 0:
        visited[pos] = cnt
    elif not flag:
        K %= cnt-visited[pos]
        flag = True
    pos = A[pos]-1
print(pos+1)
# Judge status: Accepted
def main():
    n,m = tuple([int(t)for t in input().split()])
    a = tuple([int(t)for t in input().split()])

    ans = n-sum(a)
    if ans>=0:
        print(ans)
    else:
        print(-1)

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

a_l.sort(reverse=True)
ans_n = a_l[0]
a_l2 = []
for i, val in enumerate(a_l):
    a_l2.append((abs(val-float(ans_n)/2),i))
a_l2.sort()

if a_l2[0][1] == 0:
    ans_r_index = a_l2[1][1]
else:
    ans_r_index = a_l2[0][1]
ans_r = a_l[ans_r_index]
print(ans_n, ans_r)
# Judge status: Accepted
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
sys.setrecursionlimit(500*500)
import itertools
from collections import Counter,deque

def main():
    n = int(input())
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())

    ans = (math.ceil(n/min(a,b,c,d,e)))+4
    print(ans)


if __name__=="__main__":
    main()
# Judge status: Accepted
from collections import Counter

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

cnt = Counter(A)

parts = []
for k in sorted(cnt.keys(),reverse=True):
    if cnt[k] >= 4:
        parts += [k,k]
    elif cnt[k] >= 2:
        parts.append(k)

if len(parts) >= 2:
    print(parts[0]*parts[1])
else:
    print(0)
# Judge status: Accepted
A, B = map(int, input().split())
ans = 0
for i in range(A, B + 1):
    if str(i) == str(i)[::-1]:
        ans += 1
print(ans)
# Judge status: Accepted
s, t = [], []
for i in range(int(input())):
	s.append(input())
for i in range(int(input())):
	t.append(input())

profit = 0
for i in s:
	temp = s.count(i) - t.count(i)
	if profit < temp:
		profit = temp

print(profit)
# Judge status: Accepted
import math
import collections
import fractions
import itertools
 
def solve():
    n = int(input())
    a = list(map(int, input().split()))
    c = collections.Counter(a)
    box = []
    for i in c:
        if c[i] >= 2:
            for _ in range(c[i]//2):
                box.append(i)
    if len(box) < 2:
        print(0)
    else:
        box.sort(reverse=True)
        print(box[0]*box[1])
    return 0
 
if __name__ == "__main__":
    solve()
# Judge status: Accepted
def resolve():
    pi = 3.14159265
    r = int(input())
    print(2*r*pi)
resolve()
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
Alice = list()
Bob = list()
print(a)
for i in range(n):
    if i % 2 == 0:
        Alice.append(a[i])
    else:
        Bob.append(a[i])

print(sum(Alice) - sum(Bob))