peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import numpy as np
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))

def do():
    n=INT()
    a=np.array(LIST())
    ans=0
    mod=10**9+7
    for i in range(70):
        digit=np.sum((a>>i)&1)
        ans+=pow(2,i,mod)*(((n-digit)*digit)%mod)%mod
        ans=ans%mod
    
    print(ans)



if __name__=='__main__':
    do()
# Judge status: Accepted
a, b = map(int, input().split())
for i in range(50):
    if  a * i  - (i-1) >= b:
        print(i)
        exit()
# Judge status: Accepted
a,b,c=map(int,input().split())
print('Yes' if a<c<b or b<c<a else 'No')
# Judge status: Accepted
d,n=map(int,input().split())
if(n!=100):
    print(n*100**d)
else:
    print((n+1)*100**d)
# Judge status: Wrong Answer
#!python3

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

# input
N = int(input())
A = LI()


def main():
    d = {}
    for a in A:
        d[a] = d[a] + 1 if a in d else 1
    
    l = []
    for k, v in d.items():
        if v >= 2:
            l.append(k)
    
    l.sort(reverse=True)
    ans = 0 if len(l) < 2 else l[0] * l[1]
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
check = ["A", "C", "G", "T"]

s = input()
ans = 0
tmp = 0

for i in range(len(s)):
    if s[i] in check:
        tmp += 1
    else:
        ans = max(ans,tmp)
        tmp = 0
        
print(ans)
# Judge status: Accepted
n,x = map(int,input().split())
L = list(map(int,input().split()))

d = [0]*(n+1)
d[0] = 0
for i in range(1,n+1):
    d[i] = d[i-1] +L[i-1]

print(len([i for i in d if i<=x]))
# Judge status: Wrong Answer
s1 = input()
s2 = input()

if s1[0] == s2[2] and s1[1] == s2[1] and s1[2] == s2[0]:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n,a,b = [int(x) for x in input().split()]

if (b - a) % 2 == 0:
    print((b-a)//2)
else:
    print(min((b-1), (n-a)))
# Judge status: Accepted
import math
 
def main():
    H = int(input())
    W = int(input())
    N = int(input())
 
    if H >= W:
        h = H
        w = W
    else:
        h = W
        w = H
    
    ans = math.ceil(N / h)
    print(ans)



if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N, x = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
cnt = 0
j = 0
for i in range(N):
  if (cnt + a[i]) > x:
    break
  cnt += a[i]
  j += 1
if j == len(a):
  j -= 1
print(j)
# Judge status: Accepted
number = int(input())

answer = 0
for i in range(1, number + 1):
    answer += i

print(answer)
# Judge status: Accepted
# -*- coding: utf-8 -*-


def main():
    n = int(input())
    y = list()

    for i in range(n):
        xi, li = map(int, input().split())
        # y.append((xi - li + 1, xi + li - 1))
        y.append((xi - li, xi + li))

    count = 1
    sorted_y = sorted(y, key=lambda x: x[1])
    end_point = sorted_y[0][1]

    for left, right in sorted_y[1:]:
        if left >= end_point:
            end_point = right
            count += 1

    print(count)


if __name__ == '__main__':
    main()
# Judge status: Accepted
d, t, s = (int(i) for i in input().split())

if t*s-d >=0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a = int(input())

print(a + a * a + a * a * a)
# Judge status: Accepted
# Problem C - Sqrt Inequality

# input
a, b, c = map(int, input().split())

# check
is_ok = (a * b)*4 < (c - a - b)**2 and (c-a-b)>0

# output
if is_ok:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

KEI = K*X +(N-K)*Y
print(KEI)
# Judge status: Accepted
n = int(input())

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

s.sort(reverse = True)

ans = 0

for i in range(1,2*n+1,2):
    ans += s[i]
    
print(ans)
# Judge status: Accepted
x, y = map(int, input().split())
ok = False
for i in range(x+1):
  tmp = 2*i + 4*(x-i)
  if tmp == y:
    ok = True
    break

if ok:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
N,K = [int(i)for i in input().split()]
A = [int(i) for i in input().split()]

S = []
for i in range(K-1,N):
    s = 1
    for j in range(i,i-K,-1):
        s *= A[j]
    S.append(s)

print(S)
for i in range(1,len(S)):
    print("Yes" if S[i-1]<S[i] else "No")
# Judge status: Wrong Answer
n = int(input())
l = list(map(int,input().split()))
p1 = n//2
p2 = n//2-1

for i in range(n):
    if i < p1:
        print(l[p1])
    else:
        print(l[p2])
# Judge status: Accepted
import math
N =  int(input())
print(2*math.pi*N)
# Judge status: Accepted
n = int(input())
if n == 0:
  print(0)
  exit(0)
for k in range(100):
    if -2*pow(4,k) +2 < 3*n < pow(4,k) - 1:
        break
l = 2*k

delta = n - (-2*(pow(2,l)-1)//3)

var = delta ^ (2*(pow(2,l)-1)//3)

ans = ''
while var > 0:
    if var&1:
        ans ='1'+ans
    else:
        ans ='0'+ans
    var = var >> 1
print(ans)
# Judge status: Accepted
N = int(input())

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


tmp = 1
counter = 0
for a in A:
    if a==tmp:
        counter += 1
        tmp += 1

if counter==0:
    print(-1)
else:
    print(N-counter)
# Judge status: Wrong Answer
N,M = map(int,input().split())
n = M // N
import math
m = math.floor(M**0.5)
for i in range(min(n,m)):
    x = min(n,m) - i
    if M % x == 0:
        print(x)
        quit()
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

# A - Dividing a String
S = input()

arr = [S[0]]
i = 1

while i < len(S):
	s = S[i]
	
	if s == arr[-1]:
		if i + 1 < len(S):
			i += 1
			s += S[i]
		else:
			arr[-1] += s
			break
	
	arr.append(s)
	i += 1

ans = len(arr)

if arr[-1] == arr[-2]:
	ans -= 1

print(ans)
# Judge status: Wrong Answer
D = int(input())
c = list(map(int, input().split()))
s = []
for i in range(D):
    temp_s = list(map(int, input().split()))
    s.append(temp_s)
for i in range(1, D + 1):
    print(i)
# Judge status: Accepted
H = int(input())

count = 1
while True:
    if not H > 1:
        break
    H = H // 2
    count += 1

ans = 2 ** count - 1
print(ans)
# Judge status: Accepted
_ = int(input())

stones = [int(i) for i in input().split()]

cost = [0, abs(stones[1] -stones[0])]

for i in range(2, len(stones)):
    jump_1 = cost[i-1] + abs(stones[i] - stones[i-1])
    jump_2 = cost[i-2] + abs(stones[i] - stones[i-2])
    cost.append(min(jump_1, jump_2))

print(cost[-1])
# Judge status: Accepted
n = int(input())
if n == 1:
  print(0)
else:
  print(1)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
b=0
c=0
for i in range(n):
  if i%2==0:
    b+=a[i]
  else:
    c+=a[i]
print(b-c)
# Judge status: Accepted
#!/usr/bin/env python
# coding: utf-8

# In[40]:


K = int(input())


# In[44]:


if K%2 == 0 or K%5 == 0:
    print(-1)
else:
    if K%7 == 0:
        L = 9*K//7
    else:
        L = 9*K
    ans = -1
    tmp = 0
    for i in range(1,K+1):
        if (10*tmp+9)%L == 0:
            ans = i
            break
        else:
            tmp = (10*tmp+9)%L
    print(ans)


# In[ ]:
# Judge status: Accepted
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


A, B, C = MI()
m = max(A, B, C)

ans = (m - A) // 2
A += (m - A) // 2 * 2
ans += (m - B) // 2
B += (m - B) // 2 * 2
ans += (m - C) // 2
C += (m - C) // 2 * 2

d = 3 * m - (A + B + C)
if d == 0:
    print(ans)
elif d == 1:
    print(ans + 2)
else:
    print(ans + 1)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
N, L = map(int,input().split())
A = [0] * N
B = [0] * N
for i in range(N):
  A[i] = L + i

ans = 0
diff = 10 ** 10
for j in range(N):
  B[j] = sum(A) - A[j]

print(max(B))
# Judge status: Wrong Answer
s=input()
print("YNeos"[len(s)!=len(set(s))::2])
# Judge status: Accepted
a, b = map(int, input().split())
print(((a+b+1)//2))
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = 0
cnt = 0

for i in range(N):
    if A[i] >= B[i]+cnt:
        ans += B[i]+cnt
        cnt = 0
    else:
        ans += A[i]
        cnt = B[i]+cnt-A[i]

ans += min(A[N],cnt)
print(ans)
# Judge status: Accepted
n=int(input())
for i in range(100//4):
    for j in range(100//7):
        if n==4*i+7*j:
            print("Yes")
            exit()
print("No")
# Judge status: Wrong Answer
K, S = map(int, input().split())
X = []
Y = []
Z = []
count = 0

for i in range(0 ,K + 1):
	for j in range(0 ,K + 1):
		for k in range(0 ,K + 1):
			X.append(i)
			Y.append(i)
			Z.append(i)
			if S == X[i] + Y[j] + Z[k]:
				count += 1

print(str(count))
# Judge status: Accepted
N=int(input())
X=[0]*N
L=[0]*N
t=[0]*N

for i in range(N):
  X[i],L[i]=map(int,input().split())
  t[i]=[X[i]-L[i], X[i]+L[i]]
  
t.sort(key=lambda x:x[1])
#print(t)

pos=float("-inf")
cnt=0
for arm in t:
  if pos<=arm[0]:
    cnt +=1
    pos=arm[1]
    
print(cnt)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
m = 1000
k = 0
for i in range(N-1):
  if A[i] < A[i+1]:
    k += m // A[i]
    m = m % A[i]
  elif A[i] > A[i+1]:
    m += k * A[i] 
    k = 0
m += k * A[N-1]
print(m)
# Judge status: Wrong Answer
X, Y = map(int, input().split())

mod = 10**9+7

def com(n, r):
    p, q = 1, 1
    for i in range(r):
        p = p*(n-i)%mod
        q = q*(r-i)%mod
    return (p*pow(q, mod-2, mod))%mod

if (X + Y)%3 != 0:
    print(0)

else:
    a = (2*Y-X)//3
    b = (X+Y)//3 - a
    if a > 0 and b > 0:
        print(com(a+b, a))
    else:
        print(0)
# Judge status: Accepted
n = int(input())
s = input()
t = input()

ok = False
for i in range(n):
  if s[i:n] == t[:n-i]:
    ok = True
    break
print(n+i if ok else n*2)
# Judge status: Accepted
n, l = map(int, input().split())
s = sum(l + i for i in range(n))
eaten = min((l + i for i in range(n)), key=lambda x: abs(x))
print(s - eaten)
# Judge status: Accepted
def solve(N, Y):
    for a in range(N + 1):
        for b in range(N + 1 - a):
            c = N - (a + b)
            if a * 10000 + b * 5000 + c * 1000 == Y:
                return a, b, c
    return -1, -1, -1


N, Y = [int(n) for n in input().split()]
print(*solve(N, Y))
# Judge status: Wrong Answer
from collections import defaultdict
import numpy as np

n = int(input())
p = np.array(list(map(int, input().split())))

comp = np.arange(n) + 1
diff = comp - p


memo = defaultdict(int)
memo[0] = 0

cnt = 0
for x in diff:
    if x == 0:
        cnt += 1
    else:
        memo[cnt] += 1
        cnt = 0

if diff[-1] == 0:
    memo[cnt] += 1

remove = memo.pop(0)

if memo[1] != 0:
    ans = memo.pop(1)
else:
    ans = 0

for k, v in memo.items():
    ans += (k - 1) * v

print(ans)
# Judge status: Accepted
a,b=map(int,input().split())
if a<=b:
  for i in range(b):
    print(a,end="")
else:
  for i in range(a):
    print(b,end="")
# Judge status: Accepted
N, W = map(int, input().split())
WV = [list(map(int, input().split())) for _ in range(N)]
dp = [[0] * (W+1) for i in range(N+1)]

for i in range(1,N+1):
    w, v = WV[i-1]
    for j in range(1, W+1):
        if j-w < 0:
            dp[i][j] = dp[i-1][j]
        else:
            dp[i][j] = max(dp[i][j-1], dp[i-1][j-w]+v, dp[i-1][j])

ret = 0
for i in dp:
    ret = max(ret, i[-1])
print(ret)
# Judge status: Wrong Answer
x = input()
if x:
  print(0)
else:
  print(1)
# Judge status: Accepted
n = int(input())

if n%1000 == 0:
    print(0)
else:
    print(1000-n%1000)
# Judge status: Accepted
D=int(input())
c=list(map(int, (input().split(' '))))
s=[]
for i in range(D):
    s.append(list(map(int, (input().split(' ')))))
for i in range(D):
    print(s[i].index(max(s[i])) + 1)
# Judge status: Accepted
a,b,c=map(int,input().split())
e=a-b|b-c
print(len(bin(e&-e))-3or-(e==b&1))
# Judge status: Accepted
N,K = map(int,input().split())
A = list(map(int,input().split()))

ans = (N-1)//(K-1)
if (N-1)%(K-1)!=0:
    ans+=1
print(ans)
# Judge status: Accepted
s=input()
t=input()
lt=len(t)
x=lt
for i in range(len(s)-lt+1):
  a=0
  for j in range(lt):
    if s[i+j]!=t[j]:
      a+=1
  x=min(x,a)
print(x)
# Judge status: Accepted
n,m = map(int,input().split())
if n <= m:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

S = input()
C = collections.Counter(S)
if (C["N"] and not C["S"]) or ((not C["N"]) and C["S"]) or  (C["W"] and not C["E"]) or ((not C["W"]) and C["E"]):
  print("No")
else:
  print("Yes")

# print(bool(((C["W"] and not C["E"]))))
# Judge status: Wrong Answer
import fractions
a , b , k = map(int,input().split())
f = fractions.gcd(a,b)
ans = []
for i in range(1,int(f**0.5)+1):
    if f % i == 0:
       ans.append(i)
       ans.append(f//i)
ans.sort(reverse=True)
print(ans[k-1])
# Judge status: Accepted
N , L = map(int,input().split())
nols = list(map(str,input().split()))

for i in range(10*N):
    pri = N + i
    pri = str(pri)
    if any(x in pri for x in nols):
        continue
    else:
        print(pri)
        break
# Judge status: Accepted
n = int(input())
print(pow(n, 2))
# Judge status: Accepted
import sys
input = sys.stdin.readline

n = int(input())
n = str(n)
ans = (len(n) - 1) * 9 + int(n[0])

for i in range(1, len(n)):
  if int(n[i]) != 9:
    ans -= 1
    break
    
print(ans)
# Judge status: Accepted
import numpy as np

N, K= map(int, input().split())
p = np.array(list(map(int, input().split())))

tmp = np.sum(p[:K])
max = tmp
for i in range(N-K):
    tmp = tmp-p[i]+p[i+K]
    if tmp>max:
        max = tmp

print((max+K)/2)
# Judge status: Accepted
n = int(input())
ans = 0
l = [2, 1]

for i in range(n-1):
    l.append(l[i]+l[i+1])

print(l[n])
# Judge status: Accepted
import math
N = int(input())
city_list = [list(map(int, input().split())) for _ in range(N)]
average = 0
for x1, y1 in city_list:
    for x2, y2 in city_list:
        average += math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
print(average / N)
# Judge status: Wrong Answer
from fractions import gcd
a,b,c,d = map(int, input().split())
x = (c*d) // gcd(c,d)
c1, d1, cd1 = b // c, b // d, b // x
c2, d2, cd2 = (a-1) // c, (a-1) // d, a // x
ans = (c1+d1-cd1) - (c2+d2-cd2)
print(b-a+1-ans)
# Judge status: Wrong Answer
def main():
    n = int(input())
    p = list(map(int, input().split()))

    cnt = 0
    for i in range(1,n-1):
        if p[i-1] < p[i] < p[i+1] or p[i-1] > p[i] > p[i+1]:
            print(i)
            cnt += 1
    print(cnt)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
x = int(input())

l = -(-(2000 - x - 1)//200)


      
print(l)
# Judge status: Accepted
a,b,m=map(int,input().split())
la=list(map(int,input().split()))
lb=list(map(int,input().split()))
l=[]
for i in range(m):
    x,y,c=map(int,input().split())
    l+=[la[x-1]+lb[y-1]-c]
print(min(min(l),min(la)+min(lb)))
# Judge status: Accepted
N = int(input())
p = list(map(int, input().split()))

ans = 0
i = 0

while i < N:
    if p[i] == i + 1:
        i += 2
        ans += 1
    else:
        i += 1

print(ans)
# Judge status: Accepted
N,K = map(int,input().split())
score = list(map(int,input().split()))
mae = 0
usiro = K
for i in range(N-K):
  if score[mae]<score[usiro]:
    print('Yes')
  else:
    print('No')
  mae += 1
  usiro += 1
# Judge status: Wrong Answer
a,b=(int(x) for x in input().split())

if a>b:
    for i in range(b):
        print(a,end='')
else:
    for i in range(a):
        print(b,end='')
# Judge status: Accepted
n, m=map(int, input().split())
favl=[list(map(int, input().split())) for _ in range(n)]
favset=[set(favl[i][1:favl[i][0]+1]) for i in range(n)]
allfav=favset[0]
for i in range(1, n):
  allfav=allfav & favset[i]
print(len(allfav))
# Judge status: Accepted
import sys

input = sys.stdin.readline


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

    n_1 = 0
    n_4 = 0
    for aa in a:
        if aa % 2 == 1:
            n_1 += 1
        elif aa % 4 == 0:
            n_4 += 1

    if n_1 + n_4 == N:
        ans = "Yes" if n_1 - 1 <= n_4 else "No"
    else:
        ans = "Yes" if n_1 <= n_4 else "No"
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted

from collections import defaultdict

n = int(input())
a = list(map(int, input().split()))
lInfo = defaultdict(int)
rInfo = defaultdict(int)
cnt = 0

for i in range(n):
    lInfo[a[i]+i] += 1
    rInfo[i-a[i]] += 1

for k in lInfo.keys():
    cnt += lInfo[k] * rInfo[k]
print(cnt)
# Judge status: Wrong Answer
import fractions
import math

n,X= map(int,input().split())
x = list(map(int, input().split()))
ins = 0
for i in range(n):
    if x[i] >=X:
        ins = i
        break
x.insert(ins,X)
x = sorted(x)

#print(x)

difflis = [0] * (n)

for i in range(n):
    difflis[i] = math.fabs(x[i+1] - x[i])

ans = difflis[0]
for i in range(i,len(difflis)):
    ans = fractions.gcd(ans,difflis[i])
print(int(ans))
# Judge status: Accepted
import sys

def resolve():
    N, K = list(map(int, input().split(" ")))
    A = list(map(int, input().split(" ")))
    res = 0
    covered = 0
    while True:
        if covered >= N:
            break
        if res == 0:
            covered = K
        else:
            covered += K - 1
        res += 1
    print(res)

if '__main__' == __name__:
    resolve()
# Judge status: Accepted
a, b, c = map(int,input().split())

if b - a == c - b :
    print( "YES" )
else:
    print( "NO" )
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

y=sum(a)
x=0
mn=10**18
for i in range(n-1):
    x+=a[i]
    y-=a[i]
    mn=min(mn, abs(x-y))

print(mn)
# Judge status: Accepted
from collections import Counter as C
n=int(input())
a=list(map(int,input().split()))
l=C([i+a[i]for i in range(n)])
r=C([i-a[i]for i in range(n)])
b=0
for i in l.keys():
    b+=l[i]*r[i]
print(b)
# Judge status: Accepted
a, b, k = [int(x) for x in input().split()]
count = 0
for i in range(min(a, b), -1, -1):
    if a % i == b % i == 0:
        count += 1
        if count == k:
            print(i)
            exit()
# Judge status: Accepted
a=int(input())
b=int(input())
c=int(input())
x=int(input())

cnt=0
for i500 in range(a+1):
    for i100 in range(b+1):
        for i_50 in range(c+1):
            if x==500*i500+100*i100+50*i_50:
                cnt+=1
            elif x<500*i500+100*i100+50*i_50:break
print(cnt)
# Judge status: Accepted
import sys
n = int(sys.stdin.readline().strip('\n'))
a = [list(map(int, sys.stdin.readline().strip('\n').split())) for _ in range(n)]
# dp[i+1][j]: i日目までの活動に加え、i+1日目に活動jを選んだときの幸福度の最大値
dp = [[0 for _ in range(3)] for _ in range(n+1)]
for i in range(n):
  for j in range(3):
    for k in range(3):
      if j==k: continue
      dp[i+1][k] = max(dp[i+1][k], dp[i][j] + a[i][k])
#for i in range(n+1): print(dp[i])
print(max(dp[n]))
# Judge status: Accepted
N, M = map(int, input().split())
# また答えが見つかってなければTrue
flag = True
for i in range(N, M//10 + 1):
    if M%i == 0:
        print(M//i)
        flag = False
        break
for i in range(9):
    if flag and M%(10 - i) == 0 and M//(10 - i) >= N:
        print(10 - i)
        flag = False
if flag:
    print(1)
# Judge status: Accepted
boxes = list(map(int, input().split()))
result = [boxes[2], boxes[0], boxes[1]]
print("%s %s %s" % (result[0], result[1], result[2]))
# Judge status: Accepted
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
s=list(input())
t=list(input())
for i in range(n):

    if s[i:]==t[:n-i]:
        print(n+i)
        exit()
print(2*n)
# Judge status: Wrong Answer
import math
a, b, x = map(int, input().split())
ans = 0

if a*a*b/2 < x:
    t = 2*x/(a*a) - b
    ans =  math.degrees(math.atan((b-t)/a))
else:
    t = 2*x/(a*b)
    print(t)
    ans = math.degrees(math.atan(b/t))

print(ans)
# Judge status: Wrong Answer
N = int(input())
X_list = [int(i) for i in input().split()]

low = min(X_list)
high = max(X_list)

minimum = high
for p in range(low,high) :
    tmp = 0
    for x in X_list :
        tmp += pow(x-p,2)
    
    if (tmp < minimum) :
        minimum = tmp

print(minimum)
# Judge status: Wrong Answer
S = input()

List = ['SUN','MON','TUE','WED','THU','FRI','SAT']

a = List.index(S)

if a == 0:
    a = 7

print(a)
# Judge status: Accepted
s = input()
begin = s.index('A')
end = len(s) - s[::-1].index('Z') -1
print(end - begin + 1)
# Judge status: Accepted
s = input()

if s[0] != s[1] and s[1] != s[2] and s[0] != s[2]:
  print('Yes')
else:
  print('No')
#1文字目と2文字目　2文字目と3文字目　1文字目と3文字目
# 全て異なればOK?
# aaa bbb acc X
# abc bca cba O
# Judge status: Accepted
MOD = 10 ** 9 + 7
s = int(input())
memo = [0]*(s+1)
memo[0] = 1
for i in range(s+1):
    for j in range(3,2001):
        try:
            memo[i+j] += memo[i] % MOD
        except:
            pass
print(memo[s]%MOD)
# Judge status: Wrong Answer
N, M = list(map(int, input().split()))
suuji = [-1 for _ in range(N)]

for _ in range(M):
  s, c = list(map(int, input().split()))
  if any([suuji[s-1] not in [-1, c], s > N, all([s==1, c==0, N>1])]):
    print(-1)
    break
  else:
    suuji[s-1] = c
else:
  if suuji[0] == -1:
    suuji[0] = 1
  for i in range(N):
    if suuji[i] == -1:
      suuji[i] = 0
  print(int(''.join([str(i) for i in suuji])))
# Judge status: Wrong Answer
N=int(input())
A=[]
B=[]
for i in range(N):
  a,b=map(int,input().split())
  A+=[a]
  B+=[b]
A.sort()
B.sort()
if N%2==1:
  ans=B[N//2]-A[N//2]+1
else:
  Am=A[N//2]+A[N//2-1]
  Bm=B[N//2]+B[N//2-1]
  if (Bm-Am)%2==0:
    ans=(Bm-Am)+1
  else:
    ans=(Bm-Am-1)*2
print(ans)
# Judge status: Accepted
def II(): return int(input())
def LI(): return list(map(int, input().split()))

N=II()
A=LI()
cnt=[0]*((10**6)+1)
for a in A:
  cnt[a]+=1
  
unique=[]
for i in range((10**6)+1):
  if cnt[i]==1:
    unique.append(i)
    
ans=0
cnt=[0]*((10**6)+1)
A=list(set(A))
for elem in A:
  for i in range(elem*2,(10**6)+1,elem):
    cnt[i]=1
for i in unique:
  if cnt[i]==0:
    ans+=1
print(ans)
# Judge status: Accepted
n=int(input())
s=list(input())
sw=[0]
se=[0]
swc=0
sec=0
for i in range(n):
    if s[i]=='W':
        swc+=1
    else:
        sec+=1
    sw.append(swc)
    se.append(sec)
m=n
for i in range(n+1):
    m=min(m,sw[i]+se[-1]-se[i])
print(m)
# Judge status: Accepted
s=input()

if s[-1]=="s":
    print(s+"es")

else:
    print(s+"s")
# Judge status: Accepted
def calc(n,num):
  ret=0
  while n>0:
    ret+=n%num
    n//=num
  return ret

N=int(input())
ans=N

for i in range(N+1):
  cnt=0
  cnt+=calc(i,6)
  cnt+=calc(N-i,9)
  ans=min(ans,cnt)
print(ans)
# Judge status: Wrong Answer
import bisect
N = int(input())
*A, = map(int, input().split())
t = [[A[i], i] for i in range(N)]
t.sort()

ta = [v for v, i in t]
ti = [i for v, i in t]

ans = 0
for i in range(N):
    r = N-i-ta[i]
    ri = bisect.bisect_right(ta, r)
    for j in range(i+1, ri):
        if (ta[i]+ta[j]) == abs(ti[i]-ti[j]):
            ans += 1

print(ans)
# Judge status: Wrong Answer
def main():
  n = int(input())
  flag = 0
  while n < 0:
      if n % 10 == 7:
          flag += 1
          n /= 10
  if flag > 0:
      print('Yes')
  else:
      print('No')
main()
# Judge status: Wrong Answer
# C - X: Yet Another Die Game
def main():
    x = int(input())

    if x <= 6:
        print(1)
    elif x <= 11:
        print(2)
    else:
        print(x//11*2+1)
  
        
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a, b, c = map(int,input().split())
print(min(round(b/a), c))
# Judge status: Wrong Answer
H = int(input())
W = int(input())
N = int(input())
print(N // max(H, W) + 1)
# Judge status: Wrong Answer
a=input()
b=input()
if (a.islower() and b.islower()) and (a in b) and (len(b)==len(a)+1) and len(a)<=10:
  print('Yes')
  
else :
  print('No')