peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N = int(input())
s = [int(input()) for _ in range(N)]
ans = sum(s)
if ans % 10 == 0:
    s.sort()
    for i in s:
        if i % 10 != 0:
            print(ans - i)
            exit()
    print(0)
else:
    print(ans)
# Judge status: Wrong Answer
i = input().split()

n = int(i[0])
m = int(i[1])
a = [int(i2) for i2 in i[2::]]
m2 = sum(a) // (4 * m)
c = sum([1 if i >= m2 else 0 for i in a])

if c>=m:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import sys
input = sys.stdin.readline

n, m, k = map(int, input().split())
for i in range(n + 1):
    for j in range(m + 1):
        if k == (n - i) * j + (m - j) * i:
            print('Yes')
            exit()
print('No')
# Judge status: Accepted
# coding:utf-8
number = input()
# ABCD 隙間の数は3
n = 3

for bit in range(2 ** n):
    ope = ['-'] * n
    for i in range(n):
        if ((bit >> i) & 1):
            ope[n - 1 - i] = '+'
    # print(ope)
    ans = ''

    for num, op in zip(number, ope):
        ans += num + op
    ans += number[-1]
    if eval(ans) == 7:
        print(ans + '=7')
        exit()
# Judge status: Accepted
x,k,d=map(int,input().split())
x=abs(x)
if x>k*d:
  print(x-k*d)
else:
  k-=x//d
  if k%2==0:
    print(x%d)
  else :
    print(d-x%d)
# Judge status: Accepted
from decimal import *
getcontext().prec = 20
a,b,c = map(int, input().split())
a,b,c = Decimal(a),Decimal(b),Decimal(c)
if a.sqrt() + b.sqrt() < c.sqrt():
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
A,B=map(int,input().split())
if A+B % 2 !=0:
    print("IMPOSSIBLE")
else:print((A+B)//2)
# Judge status: Wrong Answer
S = input()
N = len(S)
ans = 1
i = 1
while i < N:
    if S[i] == S[i-1]:
        i += 2
    else:
        i += 1
    ans += 1
print(ans)
# Judge status: Accepted
def main():
    S = int(input())
    y3 = (S+10**9-1)//10**9
    x3 = 10**9 * y3 - S
    print(0, 0, 10**9, 1, x3, y3)


if __name__ == '__main__':
    main()
# Judge status: Accepted
a,b,c = input().split(" ")
print(f"A{b[0]}C")
# Judge status: Accepted
#!/usr/bin/env python3

x = int(input())
a = x // 11
b = x - 11*a
if b > 6:
    print(2*a + 2)
elif x % 11 == 0:
    print(2*a)
else:
    print(2*a + 1)
# Judge status: Accepted
a = list(map(int, input().split()))
a.remove(max(a))
print(int(a[0] * a[1] / 2))
# Judge status: Accepted
def main():
    N, M = map(int, input().split())
    M2 = M//2
    if M2 <= N:
        print(M2)
        return
    m = M - N*2
    ans = N + m//4
    print(ans)

if __name__ == "__main__":
    main()
# Judge status: Accepted
N, M = map(int, input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]
be_included = False

for i in range(N - M + 1):
    for j in range(N - M + 1):
        tmp = [A[k][j:j+M] for k in range(i, i + M)]
        if tmp == B:
            be_included = True
            break
    if be_included:
        break

if be_included:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N,D = map(int, input().split())

x=N/(2*D+1)
if x.is_integer()==True:
    print(int(x))
else:
    print(int(x)+1)
# Judge status: Accepted
import sys
mina=10**10
L,R=map(int,input().split())
for i in range(L,R):
  for j in range(i+1,R+1):
    i=i%2019
    j=j%2019
    mina=min(mina,(i*j)%2019)
    if mina==0:
      print(0)
      sys.exit()
print(mina)
# Judge status: Wrong Answer
a,b=map(int, input().split())
if a==1:
  a=14
elif b==1:
  b=14
  
if a > b:
  print('Alice')
elif b >a:
  print('Bob')
else:
  print('Draw')
# Judge status: Accepted
N, M = map(int, input().split())

maxL = 0
minR = float('inf')
for _ in range(M):
    l, r = map(int, input().split())
    maxL = max(maxL, l)
    minR = min(minR, r)


ans = minR - maxL + 1
ans = max(ans, 0)
print(ans)
# Judge status: Accepted
import math

a, b, x = map(int, input().split())
S = x/a

if S > a*b/2:
	P = 2*b - 2*S/a
	theta = math.degrees(math.atan(P/a))
else:
	P = 2*S / b
	theta = math.degrees(math.atan(b/P))

print(theta)
# Judge status: Accepted
s = input()
len_s = len(s)
is_ok = False
while(is_ok == False):
    len_s -= 2
    word = s[:len_s]
    if word[:len_s // 2] == word[len_s // 2 :]:
        is_ok = True
    else:
        pass
print(len_s)
# Judge status: Accepted
x, y = map(int, input().split())
mod = 10 ** 9 + 7

cnt1 = cnt2 = 0
for i in range(x + 1):
    x_left = x - i
    y_left = y - 2 * i
    if x_left == y_left * 2:
        cnt1 = i
        cnt2 = y_left

if cnt1 == cnt2 == 0:
    ans = 0
else:
    ans = 1
    for i in range(1, cnt1 + 1):
        ans *= (cnt1 + cnt2 - i + 1)
        ans %= mod
        ans *= pow(i, mod - 2, mod)
        ans %= mod

print(ans)
# Judge status: Wrong Answer
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()

win_hand = {"r": "p", "s": "r", "p": "s"}
point = {"r": R, "s": S, "p": P}

ans = 0
hand_list = ""

for i in range(N):
    if i >= K and win_hand[T[i]] == hand_list[i-K]:
        hand_list += T[i]
    else:
        ans += point[win_hand[T[i]]]
        hand_list += win_hand[T[i]]

print(ans)
# Judge status: Wrong Answer
N = int(input())
W = [int(weight) for weight in input().split()]
sum_w = sum(W)
left_sum = 0
min = 10000
min_index = 0
for i in range(len(W)):
  left_sum += W[i]
  if abs(2*left_sum - sum_w) < min:
    min = abs(2*left_sum - sum_w)
    min_index = i
print(min_index+1)
# Judge status: Accepted
#!/usr/bin/env python3
n,m = map(int,input().split())
if n == 1 and m == 1:
    print(1)
elif n == 1 or m == 1:
    print(max(n,m)-2)
else: print((n-2)*(m-2))
# Judge status: Wrong Answer
import bisect

def main():
    N = int(input())
    a = [int(i) for i in input().split()]

    a.sort()
    n = a[-1]
    m = n // 2
    right = bisect.bisect_right(a, m)

    if a[right-1] == m:
        r = m

    elif m - a[right-1] <= a[right] - m:
        r = a[right-1]

    else:
        r = a[right]

    print(n, r)


if __name__ == "__main__":
    main()
# Judge status: Accepted
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy

def main():
    n,k = map(int, input().split())
    if n%k == 0:
        print(0)
    else:
        print(1)

if __name__ == "__main__":
    main()
# Judge status: Accepted
import math
a,b = map(int, input().split())
ans = math.ceil((a+b)/2)
print(ans)
# Judge status: Accepted
A, B = map(int, input().split())
print(B if A >= 13 else 0 if A <= 5 else B//2)
# Judge status: Accepted
n, m = map(int, input().split())
A = list(map(int, input().split()))
d = {}
for a in A:
    d[a] = 1 if a not in d else d[a] + 1
for _ in range(m):
    b, c = map(int, input().split())
    d[c] = b if c not in d else d[c] + b
ans = 0
cnt = 0
L = sorted(d, reverse=True)
for k in L:
    if d[k] + cnt < n:
        ans += k * d[k]
        cnt += d[k]
    else:
        ans += k * (n - cnt)
        break
print(ans)
# Judge status: Wrong Answer
import numpy as np
 
def calculate_num_boss(num_person, boss):
    boss_count = np.zeros([num_person])
    result, num = np.unique(boss, return_counts=True)
    for idx in range(result.shape[0]):
        ids = result[idx]
        boss_count[ids-1] = num[idx]
 
    return boss_count
 
 
if __name__ == "__main__":
    num_person = int(input().split()[0])
    bosses = np.array([int(i) for i in input().split()])
# Judge status: Wrong Answer
import math

X,Y=map(int,input().split())
#print(math.floor(math.log(Y/X,2))+1)
if 2*X<Y:
    print(math.floor(math.log(Y/X,2))+1)
else:
    print(1)
# Judge status: Wrong Answer
n,k=map(int,input().split())
S=input()
c=0
d=0
for i in range(n-1):
    if S[i]==S[i+1]:
        c+=1
    if S[i]!=S[i+1]:
        d+=1

print(c+2*d-1 if (d<=k and S[0]!=S[-1]) else c+2*k)
# Judge status: Wrong Answer
a, b = map(int, input().split())
t = input()
print(t.replace(t[b-1], t[b-1].upper()))
# Judge status: Accepted
s = input()
t = input()

my_d = dict()

for i, ch in enumerate(s):
    if ch not in my_d:
        if t[i] in my_d.values():
            print('No')
            exit()
        else:
            my_d[ch] = t[i]
    else:
        if my_d[ch] != t[i]:
            print('No')
            exit()

print('Yes')
# Judge status: Wrong Answer
from math import comb
if __name__=="__main__":
  n=int(input())
  if n==1:
    print(0)
    exit
  else:
    print(comb(n,2)*2)
# Judge status: Accepted
x, y = map(int, input().split())
if x % y == 0:
  print(-1)
  exit()
for i in range(1, 10 ** 5):
  if (x * i) % y != 0:
    print(x * i)
    exit()
# Judge status: Wrong Answer
A,B = map(int,input().split())

if (A==1 and B!=1):
    print("Alice")
    exit()
elif(B==1 and A!=1):
    print("Bob")   
   




if (A>B):
    print("Alice")
elif(A<B):
    print("Bob")
elif(A==B):
    print("Draw")
# Judge status: Accepted
grid = [list(map(int, input().split())) for _ in range(3)]
ans = 'Yes'

b1 = 0
a1 = grid[0][0]
a2 = grid[1][0]
a3 = grid[2][0]

b2 = grid[0][1] - a1
b3 = grid[0][2] - a1

if b2 + a2 != grid[1][1]:
    ans = 'No'

if b2 + a3 != grid[2][1]:
    ans = 'No'

if b3 + a2 != grid[1][2]:
    ans = 'No'

if b3 + a3 != grid[2][2]:
    ans = 'No'

print(ans)
# Judge status: Wrong Answer
print("bwuisnt"[sum(map(int,input().split())) > 22::2])
# Judge status: Accepted
N,D=[int(s) for s in input().split()]
ans=0
for i in range(N):
  a,b=[int(s) for s in input().split()]
  if a*a+b*b<=D*D:
    ans+=1
print(ans)
# Judge status: Accepted
N = int(input())
keta = len(str(N))
SN = str(N)
if N <= 9:
    print(N)
elif SN.count('9') == keta:
    print(9*keta)
elif SN.count('9') == keta-1 and SN[0] != '9':
    print((keta - 1) * 9 + int(SN[0]))
else:
    print((keta - 1) * 9 + int(SN[0])-1)
# Judge status: Wrong Answer
N=int(input())
A=[0]*10**5
b=input().split()
numbers=[int(a) for a in b]
for a in numbers:
    A[a-1]+=1
list=[]
for z in range(10**5-2):
    y=A[z]+A[z+1]+A[z+2]
    list.append(y)
print(max(list))
# Judge status: Accepted
import sys

S = input()

for i in range(0, len(S)-1):
    if S[i] == S[i+1]:
        print('Bad')
        sys.exit()

print('Good')
# Judge status: Accepted
n, m = list(map(int, input().split()))
a = [input() for _ in range(n)]
b = [input() for _ in range(m)]

ans = False
for y in range(n-m+1):
    for x in range(n-m+1):
        sol = True
        for h in range(m):
            if a[y+h][x:x+m] != b[h]:
                sol = False
                break

        if sol:
            ans = True
            break
    if ans:
        break

print("Yes" if ans else "No")
# Judge status: Accepted
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter
from operator import mul
from functools import reduce


x,y,a,b,c = list(map(int, input().split()))
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p = sorted(p, reverse=True)[:x]
q = sorted(q, reverse=True)[:y]
r = sorted(r, reverse=True)

pq = sorted(p+q)
ans = sum(pq)

for i in range(len(r)):
    if pq[i] < r[i]:
        ans = ans + r[i] -pq[i]
    else:
        break

print(ans)
# Judge status: Wrong Answer
a = []
a = input().split()
N = int(a[0])
K = int(a[1])
H = input().split()
H = [int(i) for i in H]
#print('N=', N, 'K=', K)
#print('H=', H)

H = sorted(H, reverse = True)
#print('sort H=', H)

if K == 0:
  H = H
if K == 1:
  del H[0]
if K > 1:
  del H[0 : K - 1]
#print('del H=', H)

T = sum(H)
print(T)
# Judge status: Accepted
import numpy as np

S = input()
T = input()

m = len(S)
n = len(T)
for i in range(m-n, -1, -1):
  if np.prod([s in [t, '?'] for s, t in zip(S[i:i+m], T)]):
    ans = S[:i] + T + S[i+n:]
    ans = ans.replace('?', 'a')
    break
else:
  ans = 'UNRESTORABLE'
print(ans)
# Judge status: Accepted
A,B = map(int,input().split())

if A >= 13:
    print(B)
elif A <= 5:
    print(0)
else:
    print(int(B/2))
# Judge status: Accepted
S=input()
S0=S[::2]
S1=S[1::2]
print(min(len(S)-S0.count("0")-S1.count("1"),len(S)-S0.count("1")-S1.count("0")))
# Judge status: Accepted
a,b,c,d = map(int,input().split())
if abs(a-b) <= d and abs(b-c) <= d:
    print("Yes")
elif abs(a-c) <= d:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

ans = 1
t = 1e18
if 0 in a:
    print(0)
    exit(0)

for i in range(n):
    ans *= a[i]
    if ans > t:
        print(-1)
        exit(0)

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

if A + B >= K:
    print(A)
else:
    print(A - (K - (A + B)))
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))

B={}
for i,j in enumerate(A):
    B[j]=i+1

ansdic=sorted(B.items(), key=lambda x:x[0])
l=[]
for i in ansdic:
    l.append(i[1])

print(l)
# Judge status: Wrong Answer
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left, bisect_right #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

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

mi = A.index(1)
lc = math.ceil(mi/2)
rc = math.ceil((N-mi-1)/2)

print(lc+rc)
# Judge status: Accepted
n, k = map(int, input().split())

cur = 1
while n // (k ** cur) > 0:
    cur += 1
print(cur)
# Judge status: Wrong Answer
N = int(input())

if N < 105:
    print(0)
elif N < 165:
    print(1)
elif N < 195:
    print(2)
else:
    print(3)
# Judge status: Accepted
n,a,b,c,d = map(int,input().split())
s = input()
if c<d:
  if "##" not in s[a-1:d]:
    print("Yes")
  else:
    print("No")
else:
  if "..." in s[b-2:d]:
    print("Yes")
  else:
    if s[d-2]=="#":
      print("No")
    else:
      print("Yes")
# Judge status: Wrong Answer
t = list(input())

for i in range(len(t)-1):
    # ?が出たら前後の値から考える
    if t[i] == '?':
        if t[i+1] == 'D':
            t[i] = 'P'
        elif t[i+1] == '?' and t[i-1] != 'P':
            t[i] = 'P'
        else:
            t[i] = 'D'
if t[len(t)-1] == '?':
    t[len(t)-1] = 'D'
print("".join(t))
# Judge status: Accepted
N, K, Q = map(int, input().split())
A = []
for i in range(Q):
    a = int(input())
    A.append(a)

l = list()
for i in range(N):
    l.append(K-Q)

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

for j in l:
    if j > 0:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
x = int(input())
if 1 <=x%11 <= 6:
    print(x//11*2+1)
elif 7 <= x%11 <= 10:
    print(x//11*2+2)
else:
    print(x//11*2)
# Judge status: Accepted
H, W = map(int, input().split())

import math

if H == 1 or W == 1:
    print(1)
else:
    print(math.ceil(H * W / 2))
# Judge status: Accepted
A,B,C,K=input().split()
A=int(A)
B=int(B)
C=int(C)
K=int(K)
if (0<=A)and(0<=B)and(0<=C)and(1<=K<=A+B+C<=2*10**9):
    if K<=A:
        print(K)
    if A<K<=A+B:
        print(A)
    if A+B<K<=A+B+C:
        a=A-(K-A-B)
        print(a)
# Judge status: Wrong Answer
w, a, b = list(map(int, input().split()))
print(abs(b - (a + w)))
# Judge status: Wrong Answer
x = int(input())

ans = x // 11 * 2 + (x % 11) // 6 + 1
print(ans)
# Judge status: Wrong Answer
N = int(input())

def digit_sum(A):
    S = 0
    while A > 0:
        S += A % 10
        A //= 10
    return S

ans = N
for A in range(N):
    cand = digit_sum(A) + digit_sum(N - A)
    ans = min(ans, cand)

print(ans)
# Judge status: Wrong Answer
a,b=sorted(map(int,input().split()))
#ユークリッドの互除法
def gcd(a,b):
    if b==0:
        return a
    else:
        return (gcd(b,a%b))
        #recursive function

print(gcd(a,b)*a*b)
#ユークリッドの互除法)
# Judge status: Accepted
date = input()

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

for i in range(len(List)):
    if List[i] == date:
        print(i+1)
# Judge status: Accepted
import itertools
n,m,q=list(map(int,input().split()))
abcd=[[] for i in range(q)]
for i in range(q):
    abcd[i]=list(map(int,input().split()))
ans=0
l=list(itertools.combinations_with_replacement([a for a in range(1,m+1)],n))
x=(len(l))
for i in range(x):
    e=l[i]
    
    wa=0
    for t in range(q):
        if e[abcd[t][1]-1]-e[abcd[t][0]-1]==abcd[t][2]:
            wa+=abcd[t][3]
    ans=max(ans,wa)
print(ans)
# Judge status: Wrong Answer
N = int(input())

A = [0] * N
for i in range(N):
    A[i] = int(input())

ans = 1
cur_min = A[0]
for i in range(1, N):
    if A[i] <= cur_min:
        ans += 1
        cur_min = A[i]

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

a, b = map(int, sys.stdin.readline().split())

def main():
    print(min(a, b))

if __name__ ==  '__main__':
    main()
# Judge status: Wrong Answer
import math

a = input()
sum = 0
for i in range(int (a)):
    for j in range(int(a)):
        for k in range(int(a)): 
            sum += math.gcd(math.gcd(i+1,j+1),k+1)
print
# Judge status: Accepted
#!/usr/bin/env python3
import sys
from itertools import chain


def solve(S: str, T: str):
    answer = sum([s != t for s, t in zip(S, T)])
    return answer


def main():
    tokens = chain(*(line.split() for line in sys.stdin))
    S = next(tokens)  # type: str
    T = next(tokens)  # type: str
    answer = solve(S, T)
    print(answer)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
print("YES" if b-a==c-a else "NO")
# Judge status: Wrong Answer
N = int(input())

count = 0
t_pre, x_pre, y_pre = 0, 0, 0

for i in range(N):
    t, x, y = map(int, input().split())
    
    if (abs(x - x_pre) + abs(y - y_pre) <= t - t_pre) and t%2 == (x + y)%2 :
        print('Yes')

    else:
        print('No')
# Judge status: Accepted

import random

name = input()

n = random.choice(name)
    
while name.find(n) > len(name) - 3:
    n = random.choice(name)

num = name.find(n)
for i in range(3):
    print(name[num + i], end = "")
# Judge status: Accepted
A=int(input())
B=int(input())
C=int(input())
X=int(input())
res=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:
        res+=1
print(res)
# Judge status: Accepted
from collections import Counter

n = int(input())
s = list(input() for _ in range(n))
m = int(input())
t = list(input() for _ in range(m))

res = Counter(s)
for i in range(m):
    if t[i] in res:
        res[t[i]] -= 1

ans = 0
for v in res.values():
    ans = max(ans, v)

print(ans)
# Judge status: Accepted
def solve(a, b):
    mod = b%a
    if mod == 0:
        return a
    else:
        return solve(mod, a)

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

minA = min(A)
B = [a%minA for a in A]
print(solve(minA, max(B)))
# Judge status: Wrong Answer
X=int(input())
for i in range(X,10**6):
  for j in range(2,i):
    if i%j==0:
      break
    if j==i-1:
      print(i)
      exit()
# Judge status: Accepted
N,D=map(int,input().split())
ans=0
for _ in range(N):
    X,Y=map(int,input().split())
    if X*X+Y*Y<=D*D:
        ans+=1
print(ans)
# Judge status: Accepted
n, K = map(int, input().split())
As = list(map(int, input().split()))

# doubling
m = 0
while 2**m < K:
    m += 1
d = [[0] * n for i in range(m)]
for i in range(n):
    d[0][i] = As[i] - 1 

for k in range(m-1):
    for i in range(n):
        d[k+1][i] = d[k][d[k][i]]

now = 0
for k in range(m):
    if (K >> k) & 1:
        now = d[k][now]

print(now+1)
# Judge status: Accepted
w = list(input())
a = list("abcdefghijklmnopqrstuvwxyz")
f = 0
for i in range(26):
    if w.count(a[i]) % 2 == 1:
        f = 1
print("Yes" if f == 0 else "No")
# Judge status: Wrong Answer
a,b = map(int, input().split())
mafs = 0 
if a < 1:
  print(0)
else:
  for i in range(a, b+1):
    mafs *= i
    
print(mafs)
# Judge status: Accepted
A,B,K = map(int, open(0).read().split())
if K <= A:
    print(A-K,B)
elif K >= A + B:
    print(0,0)
else:
    print(0,B-K+A)
# Judge status: Accepted

import sys
import math
import string

ALPHABET = string.ascii_lowercase
result = []

def alphabet_decimal(v):
    quotient = math.floor(v / len(ALPHABET))
    surplus = v % len(ALPHABET)
    quotient -= 1 if surplus == 0 else 0
    surplus = len(ALPHABET) if surplus == 0 else surplus
    result.append(surplus)
    if len(ALPHABET) < quotient:
        alphabet_decimal(quotient)
    elif len(ALPHABET) < v:
        result.append(quotient)
    return "".join([ALPHABET[i - 1] for i in reversed(result)])

print(alphabet_decimal(int(input())))
# Judge status: Accepted
a,b,c=map(int,input().split())
if (b*10+c)%4==0:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
n=int(input())

xy=[[int(_) for _ in input().split()]for i in range(n)]

print(max(max([a[0]+a[1] for  a in xy])-min([a[0]+a[1] for  a in xy]),max([a[0]-a[1] for  a in xy])-min([a[0]-a[1] for  a in xy])))
# print(max([a[0]-a[1] for  a in xy])-min([a[0]-a[1] for  a in xy]))
# Judge status: Wrong Answer
X = int(input())
ans = (X // (5 + 6)) * 2
if X % (5 + 6) <= 6:
    ans += 1
else:
    ans += 2
print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
 
if N % K != 0:
  print(1)
else:
  print(0)
# Judge status: Wrong Answer
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        N, L = map(int, input().split())
        total = N * L - N + N * (N + 1) // 2
        if L < 0:
            if L + N >= 0:
                print(total + 1)
            else:
                print(total - (L + N - 1))
        else:
            print(total - L)


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

l_max = 0
r_min = 10**9

for i in range(m):
    l, r = map(int, input().split())
    l_max = max(l_max, l)
    r_min = min(r_min, r)

ans = 0
for i in range(l_max, r_min+1):
    ans += 1

print(ans)
# Judge status: Wrong Answer
import numpy as np  
N, M, X = map(int, input().split())
a = np.array([input().split() for l in range(N)], dtype=np.int64)
sum = np.sum(a, axis=0)
sum = sum[1:M+1]
if np.min(sum)<X:
  print(-1)
# Judge status: Wrong Answer
N = int(input())
A = []
B = []

for i in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

A = A[::-1]
B = B[::-1]

count = 0
for i in range(N):
    if A[i] % B[i] != 0:
        count += (B[i] - (A[i] + count) % B[i])

print(count)
# Judge status: Wrong Answer
n=int(input())
s=[input() for i in range(n)]
m=int(input())
t=[input() for i in range(m)]
l=list(set(s))
print(max(0,s.count(l[i])-t.count(l[i])) for i in range(len(l)))
# Judge status: Accepted
X,Y =map(int,input().split())
print(int(X+Y/2))
# Judge status: Accepted
S = input()

if (S == "AAA"):
    print("No")
elif (S == "BBB"):
    print("No")
else:
    print("Yes")
# Judge status: Accepted
w, h, n = map(int,input().split())
p = [list(map(int,input().split())) for i in range(n)]

l, r, b, t = 0, w, 0, h
for i in range(n):
    if p[i][2] == 1:
        l = max(l, p[i][0])
    if p[i][2] == 2:
        r = min(r, p[i][0])
    if p[i][2] == 3:
        b = max(b, p[i][1])
    if p[i][2] == 4:
        t = min(t, p[i][1])

W = r-l if r > l else 0
H = t-b if t > b else 0
print(W*H)
# Judge status: Accepted
s = input()
if any(s[:i]+s[-7+i:] == 'keyence' for i in range(8)):
    print('YES')
else:
    print('NO')
# Judge status: Accepted
x = int(input())
num = 0

for i in range(x,x*2):
    for j in range(2,x//2):
        if i%j == 0:
            num += 1
            continue
    if num == 0:
        print(i)
        exit(0)
    num = 0
# Judge status: Accepted
ab,bc,ca = map(int,input().split())
print(ab * bc // 2)
# Judge status: Wrong Answer
n, a, b = map(int, input().split())
ans = 0
for x in range(n + 1):
    sum = 0
    temp = x
    for id in range(4):
        sum += temp % 10
        if temp < 10: break
        else: temp //= 10
    if a <= sum <= b: ans += x
print(ans)
# Judge status: Wrong Answer
n = int(input())
X = list(map(int, input().split()))
x = sorted(X)

res1 = x[n//2]
res2 = x[n//2 -1]

for i in range(n):
  if x[i] >= res1:
    print(res2)
  elif x[i] <= res2:
    print(res1)
# Judge status: Accepted
import math

X = int(input())

A = 100
t = 0
while A < X:
    A *= 1.01
    A = math.floor(A)
    t += 1

print(t)