Harryxun/stf_run huggingface dataset:
s = str(input())

while True:
    if s[0] == "k":
        break
    else:
        s = s[1:]
if len(s) < 7:
    print("NO")
else:
    middlerange = len(s) - 7
    if s[0]+s[middlerange+1:] == "keyence":
        print("YES")
    elif s[0:2]+s[middlerange+2:] == "keyence":
        print("YES")
    elif s[0:3]+s[middlerange+3:] == "keyence":
        print("YES")
    elif s[0:4]+s[middlerange+4:] == "keyence":
        print("YES")
    elif s[0:5]+s[middlerange+5:] == "keyence":
        print("YES")
    elif s[0:6]+s[middlerange+6:] == "keyence":
        print("YES")
    elif s[0:7]+s[middlerange+7:] == "keyence":
        print("YES")
    else:
        print("NO")

### FIXED CODE ###

s = str(input())
for i in range(len(s)):
    for j in range(i, len(s)):
        a = s[:i] + s[j:]
        if a == "keyence":
            print("YES")
            exit()
print("NO")
n = int(input())
a = list(map(int, input().split()))
s = 0
for g in range(len(a)):
    s += a[g]
e = [0] * 10001
for i in a:
    e[i] += 1
q = int(input())
bc = [list(map(int, input().split())) for _ in range(q)]
for j in range(q):
    s += (bc[j][1] - bc[j][0]) * e[bc[j][0]]
    e[bc[j][1]] += e[bc[j][0]]
    e[bc[j][0]] = 0
    print(s)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
q = int(input())
bc = [list(map(int, input().split())) for _ in range(q)]
s = 0
for g in range(len(a)):
    s += a[g]
e = [0] * 100001
for i in a:
    e[i] += 1
for j in range(q):
    s += (bc[j][1] - bc[j][0]) * e[bc[j][0]]
    e[bc[j][1]] += e[bc[j][0]]
    e[bc[j][0]] = 0
    print(s)
import itertools
from pprint import pprint

d,g = map(int,input().split())

plist=[]
clist=[]

bonus_masterlist=[]

for _ in range(d):
    p_temp,c_temp = map(int,input().split())
    plist.append(p_temp)
    clist.append(c_temp)


bonus_masterlist = list(itertools.product(range(2), repeat=5))
#bit全探索をやらなくても、itertoolsを使えば一瞬でできちゃう。(タプルのリスト)
#for i in range(2**d):
#    bonus_templist = [0] * d
#    for j in range(d):
#        if i >> j & 1:
#            bonus_templist[d-1-j] = 1
#    bonus_masterlist.append(bonus_templist)

#point_list = [100,200,300, ... ,d*100]
#max_list: plist = [p[0],p[1],p[2], ... ,p[d]]
#bonuspoint_list: clist = [c[0],c[1],c[2], ... ,c[d]]

count_list = [0] * d

mincount = 100 * 10

def dfs(i):
    global mincount
    if sum([count_list[i] * 100*(i+1) for i in range(d)]) + sum([bonus_list[j] * clist[j] for j in range(d)]) >= g:
        if sum(count_list) < mincount:
            mincount = sum(count_list)
    elif plist[i] == count_list[i]:
        bonus_list[i] = 1
        dfs(i-1)
    elif plist[i] > count_list[i]:
        count_list[i] += 1
        dfs(i)
    return

for bonus_tuple in bonus_masterlist:
    bonus_list = list(bonus_tuple)
    count_list = [x * y for (x, y) in zip(bonus_list, plist)]
    dfs(d-1)

print(mincount)

### FIXED CODE ###

import itertools
from pprint import pprint


d,g = map(int,input().split())

plist=[]
clist=[]

bonus_masterlist=[]

for _ in range(d):
    p_temp,c_temp = map(int,input().split())
    plist.append(p_temp)
    clist.append(c_temp)


bonus_masterlist = list(itertools.product(range(2), repeat=d))
#bit全探索をやらなくても、itertoolsを使えば一瞬でできちゃう。(タプルのリスト)
#for i in range(2**d):
#    bonus_templist = [0] * d
#    for j in range(d):
#        if i >> j & 1:
#            bonus_templist[d-1-j] = 1
#    bonus_masterlist.append(bonus_templist)

#point_list = [100,200,300, ... ,d*100]
#max_list: plist = [p[0],p[1],p[2], ... ,p[d]]
#bonuspoint_list: clist = [c[0],c[1],c[2], ... ,c[d]]

count_list = [0] * d

mincount = 100 * 10

"""
def dfs(i):
    global mincount
    if sum([count_list[i] * 100*(i+1) for i in range(d)]) + sum([bonus_list[j] * clist[j] for j in range(d)]) >= g:
        if sum(count_list) < mincount:
            mincount = sum(count_list)
    elif plist[i] == count_list[i]:
        bonus_list[i] = 1
        dfs(i-1)
    elif plist[i] > count_list[i]:
        count_list[i] += 1
        dfs(i)
    return
"""

for bonus_tuple in bonus_masterlist:
    bonus_list = list(bonus_tuple)
    count_list = [x * y for (x, y) in zip(bonus_list, plist)]
    i = d-1
    while True:
        if sum([count_list[i] * 100*(i+1) for i in range(d)]) + sum([bonus_list[j] * clist[j] for j in range(d)]) >= g:
            if sum(count_list) < mincount:
                mincount = sum(count_list)
            break
        elif plist[i] == count_list[i]:
            bonus_list[i] = 1
            i -= 1
            continue
        elif plist[i] > count_list[i]:
            count_list[i] += 1
            continue


print(mincount)
def solve( p, t ):
	global isExist
	global n
	global A
	isExist[ t ] = True
	if p < n:
		solve( p+1, t-A[p] )
		solve( p+1, t )

isExist = [False]*2001 
n = int( input() )
A = map( int, input().split( " " ) )
q = int( input() )
M = map( int, input().split( " " ) )
s = sum( A )
solve( 0, s )
for i in range( 0, q ):
	if isExist[ M[i] ]:
		print( "yes" )
	else:
		print( "no" )

### FIXED CODE ###

def solve( p, t ):
	global isExist, n, A
	isExist[ t ] = True
	if p < n:
		solve( p+1, t-A[p] )
		solve( p+1, t )
	else:
		return

isExist = [False]*2001 
n = int( input() )
A = [ int( val ) for val in input().rstrip().split( ' ' ) ]
q = int( input() )
M = [ int( val ) for val in input().rstrip().split( ' ' ) ]
s = sum( A )
solve( 0, s )
for i in range( 0, q ):
	if isExist[ M[i] ]:
		print( "yes" )
	else:
		print( "no" )
#!/usr/bin/env python

def main(N, H):
    ans = 'Yes'

    min_val = H[0] -1
    for i in range(1, N):
        if min_val <= H[i] -1:
            min_val = H[i] -1
        elif min_val <= H[i]:
            min_val = h[i]
        else:
            ans = 'No'
            break
    return ans

if __name__ == '__main__':
    N = int(input())
    H = list(map(int, input().split()))
    print(main(N, H))


### FIXED CODE ###

#!/usr/bin/env python

def main(N, H):
    ans = 'Yes'

    min_val = H[0] -1
    for i in range(1, N):
        if min_val <= H[i] -1:
            min_val = H[i] -1
        elif min_val <= H[i]:
            min_val = H[i]
        else:
            ans = 'No'
            break
    return ans

if __name__ == '__main__':
    N = int(input())
    H = list(map(int, input().split()))
    print(main(N, H))
N, M = map(int, input().split())
an = list(map(int, input().split()))



def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

numpy = np.array(an)
numpy = numpy//2
LCM = lcm_list(numpy.tolist())
if LCM > M:
    print(0)
else:
    print(-(-(M // LCM)//2))

### FIXED CODE ###

import fractions
from functools import reduce
import numpy as np
import sys

N, M = map(int, input().split())
an = list(map(int, input().split()))


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


def listdivide(list):
    numpy = np.array(list)
    numpy = numpy//2
    return numpy.tolist()


def divide2(x):
    res = 0
    while x % 2 == 0:
        x /= 2
        res += 1
    return res


# while gcd_list(an) % 2 == 0:
#     print(gcd_list(an))
an = listdivide(an)

t = divide2(an[0])
for i in range(1, N):
    if divide2(an[i]) != t:
        print(0)
        sys.exit()

for i in range(t):
    an = listdivide(an)
    M = M // 2

LCM = lcm_list(an)

if LCM > M == 0:
    print(0)
else:
    print(-(-(M // LCM)//2))
N=int(input())
count=0
a=list(map(int,input().split()))
w=[]
s=[]
maxi=max(a)
mini=min(a)
num=[0]*(maxi-mini+N+N)
maxi=max(a)
for i in range(N):
  w.append(1+i+a[i])
  s.append(1+i-a[i])
  num[1+i-a[i]+(maxi-mini+N+N)//2]+=1
for i in range(N):
  count+=num[w[i](maxi-mini+N+N)//2]
print(count)

### FIXED CODE ###

N=int(input())
count=0
a=list(map(int,input().split()))
w=[]
s=[]
num=[0]*N
maxi=max(a)
for i in range(N):
  s.append(1+i-a[i])
  if 1+i+a[i]<N:
    num[1+i+a[i]]+=1
for i in range(N):
  if s[i]>=0:
    count+=num[s[i]]
print(count)
n = int(input())
lst = [input() for _ in range(n)]

finA = 0
topB = 0
B2A = 0
cnt = 0

for l in lst:
    cnt += l.count('AB')
    if l[0]=='B' and l[-1]=='A':
        B2A += 1
    else:
        if l[0]=='B':
            topB += 1
        elif l[-1]=='A':
            finA += 1

if BtoA==0:
    cnt += min(finA, topB)
else:
    if finA==0 and topB==0:
        cnt += BtoA - 1
    else:
        cnt += BtoA + min(finA, topB)
print(cnt)

### FIXED CODE ###

n = int(input())
lst = [input() for _ in range(n)]

finA = 0
topB = 0
BtoA = 0
cnt = 0
for l in lst:
    cnt += l.count('AB')
    if l[0]=='B' and l[-1]=='A':
        BtoA += 1
    else:
        if l[0]=='B':
            topB += 1
        elif l[-1]=='A':
            finA += 1

if BtoA==0:
    cnt += min(finA, topB)
else:
    if finA==0 and topB==0:
        cnt += BtoA - 1
    else:
        cnt += BtoA + min(finA, topB)
print(cnt)
a,b,c,d = [int(x) for x in input().sprit()]
print(a*b) if (a*b) >= (c*d) else print(c*d)


### FIXED CODE ###

a,b,c,d = [int(x) for x in input().split()]
print(a*b) if (a*b) >= (c*d) else print(c*d)
# coding: utf-8
from functools import lru_cache


def solve(*args: str) -> str:
    n, m = map(int, args[0].split())

    keys = list(zip(
        list(map(lambda _: int(_.split()[0]), args[1::2])),
        map(
            lambda _: set2bin(
                set(map(int, _.split())),
                n, start=1
            ), args[2::2])
    ))
    dp = DP(keys, n)

    return str(
        dp.search_min_cost(0, 0)
    )


class DP:
    def __init__(self, keys: list, n: int):
        self.keys = keys
        self.mask = int('1'*n, 2)

    @lru_cache(maxsize=None)
    def search_min_cost(self, index: int, unlocked: int) -> int:
        ret = 0

        if len(self.keys) == index:
            if unlocked != self.mask:
                ret = -1

        else:
            a, C = self.keys[index]
            take = self.search_min_cost(index+1, C | unlocked)
            skip = self.search_min_cost(index+1, unlocked)

            if take == -1 and skip == -1:
                ret = -1
            elif take == -1:
                ret = skip
            elif skip == -1:
                ret = a + take
            else:
                ret = min(a+take, skip)

        return ret


def set2bin(S: set, n: int, start: int = 0) -> int:
    ret = 0
    for s in S:
        ret += 2**(s-start)
    return ret


def bin2int(B: list) -> int:
    ret = 0
    for n in range(len(B)):
        if B[n]:
            ret += 2**n

    return ret


if __name__ == "__main__":
    nm = input()
    _, m = map(int, nm.split())
    print(solve(*([nm]+[input() for _ in range(2*m)])))


### FIXED CODE ###

# coding: utf-8
from functools import reduce


def solve(*args: str) -> str:
    a_max = 1+12*10**5
    n, m = map(int, args[0].split())
    cache = {}

    for i in range(1, 1+2*m, 2):
        a, _ = map(int, args[i].split())
        c = reduce(
            lambda x, y: x | 1 << y-1,
            [0] + list(map(int, args[i+1].split()))
        )
        cache[c] = min(cache.get(c, a_max), a)

    for C in tuple(cache.items()):
        unlocked, cost = C
        for E in tuple(cache.items()):
            c, a = E
            cache[unlocked | c] = min(
                cache.get(unlocked | c, a_max),
                a + cost
            )

    return str(cache.get(2**n-1, -1))


if __name__ == "__main__":
    nm = input()
    _, m = map(int, nm.split())
    print(solve(*([nm]+[input() for _ in range(2*m)])))
n = int(input())
arr = [0]*n

for i in range(n):
	city, score = input().split()
    arr[i] = [city, int(score), i+1]
arr.sort(key = lambda x: (x[0], -x[1]))
for ele in arr:
  print(arr[2])

### FIXED CODE ###

n = int(input())

arr= [0]*n

for i in range(n):
	city, score = input().split()
	arr[i] = [city, int(score), i+1]

arr.sort(key = lambda x:(x[0],-x[1]))

for ele in arr:
	print(ele[2])
import math
X = int(input())

for A in range(100):
  C = A ** 5 - X
  B = math.sqrt(C)
  if B % 1 == 0:
    print(str(A) + " " + str(B))
    break
    
for B in range(100):
  C = B ** 5 + X
  A = math.sqrt(C)
  if A % 1 == 0:
    print(str(A) + " " + str(B))
    break

### FIXED CODE ###

X = int(input())
for A in range(-120, 120):
  for B in range(-120, 120):
    if A**5 - B**5 == X:
      print(str(A) + " " + str(B))
      quit()
a,b=map(int,input().split())
s=input()
s[b-1]=s[b-1].lower()
print(s)


### FIXED CODE ###

n,k=map(int,input().split())
s=input()
print(s[:k-1]+s[k-1].lower()+s[k:])
data = input().split()
a = int(data[0])
b = int(data[1])

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

### FIXED CODE ###

a, b = map(int,input().split())
c = a*b
if c%2==0:
  print("Even")
else:
  print("Odd")
n = int(input())

def j(b):
    print(b)
    return b, input()[0]

def q(l, r, t):
    m, rm = j((l + r + 1) // 2)
    if (m - b)%2 == (rm != t):
        q(m, r, rm)
    else:
        q(l, m-1, t)

_, s = j(0)
q(0, n-1, s)

### FIXED CODE ###

x, y = map(int,input().split())
print([x, -1][x%y==0])
S = input()
ans = 0
S = S.repace("><"/, ">,<").split(",")
for s in S:
  a = s.count(">")
  b = s.count("<")
  ans += a * (a - 1) // 2 + b * (b - 1) // 2 + max(a, b)
print(ans)

### FIXED CODE ###

S = input()
ans = 0
S = S.replace("><", ">,<").split(",")
for s in S:
  a = s.count(">")
  b = s.count("<")
  ans += a * (a - 1) // 2 + b * (b - 1) // 2 + max(a, b)
print(ans)
today_weather = int()
 
if today_weather = ‘Sunny’:
    tomorrow_weather = "Cloudy"
 
elif today_weather = ‘Cloudy’:
    tomorrow_weather = "Rainy"
 
elif today_weather = ‘Rainy’:
    tomorrow_weather = "Suuny"
 
print(tomorrow_weather)

### FIXED CODE ###

S = input()

if S == 'Sunny':
    print("Cloudy")

elif S == 'Cloudy':
    print("Rainy")

elif S == 'Rainy':
    print("Sunny")
H, W, D = map(int, input().split())

A = [list(map(int, input().split())) for i in range(H)]
rA = [[0 for j in range(2)] for i in range(H * W + 1)]
S = [0 for i in range(H * W + 1)]
for i in range(H):
	for j in range(W):
		rA[A[i][j]][0] = i
		rA[A[i][j]][1] = j

Q = int(input())
for i in range(Q):
	L, R = map(int, input().split())
	ans = 0
	for j in range(H * W) [L::D]:
		if j == R:
			break
		if S[j]:
			ans += S[j]
			break
		S[j] -= ans
		ans += abs(rA[j + D][1] - rA[j][1]) + abs(rA[j + D][0] - rA[j][0])
	for j in range(H * W)[L::D]:
		if S[j] > 0:
			break
		if j == R
			break
		S[j] += ans
	print (ans)


### FIXED CODE ###

H, W, D = map(int, input().split())
 
A = [list(map(int, input().split())) for i in range(H)]
rA = [[0 for j in range(2)] for i in range(H * W + 1)]
S = [0 for i in range(H * W + 1)]
for i in range(H):
	for j in range(W):
		rA[A[i][j]][0] = i
		rA[A[i][j]][1] = j
 
Q = int(input())
for i in range(Q):
	L, R = map(int, input().split())
	ans = 0
	for j in range(H * W) [L::D]:
		if j + D > H * W:
			break
		if S[j]:
			ans += S[j]
			break
		S[j] -= ans
		ans += abs(rA[j + D][1] - rA[j][1]) + abs(rA[j + D][0] - rA[j][0])
	for j in range(H * W)[L::D]:
		if S[j] > 0:
			break
		if j + D > H * W:
			break
		S[j] += ans
	print(S[L] - S[R])
#!/mnt/c/Users/moiki/bash/env/bin/python
D,G = map(int, input().split())
points = [ [int(j) for j in input().split()] for _ in range(D)]
points = [ [x[0], x[1], 100*e*x[0]] for e,x in enumerate(points, 1)]

ans = float("inf")
for i in range(1<<D): # for complete bonus bit set 
    lg = G
    cnt = 0
    for d in range(D):
        if i & (1<<d) != 0:
            lg -= points[d][1] # complete bonus
            # lg -= (100*(d+1))*points[d][0] # normal points
            lg -= points[d][2] # normal points
            cnt += points[d][0]
            if lg <= 0:
                break
    if lg <= 0:
        ans = min(ans, cnt)
        continue
    
    # other points
    for d in range(D-1, -1, -1):
        if i & (1<<d) != 0: continue

        if lg <= points[d][2]:
            quot = (lg+(100*(d+1)-1)) // (100*(d+1)) # carryUp
            lg -= 100*(d+1)*quot
            cnt += quot;  break
        else:
            cnt += points[d][0]
            lg -= points[d][2]
    if lg <= 0:
        ans = min(ans, cnt)
        continue
print(ans)


### FIXED CODE ###

#!/mnt/c/Users/moiki/bash/env/bin/python
# N,M = map(int, input().split())
N = int(input())
if N == 0:
    print(0)
    exit(0)

if N >= 0:
    b = bin(N)[2:]

    lst = [0 for _ in range(len(b)+10)]

    for e,s in enumerate(reversed(b)):
        if e % 2 == 0:
            lst[e] += int(s)
        elif e % 2 == 1:
            lst[e] += int(s)
            lst[e+1] += int(s)

    for e,s in enumerate(lst):
        if s >= 2:
            # if e % 2 == 0:
            while lst[e] > 1:
                lst[e] -= 2
                if lst[e+1] > 0:
                    lst[e+1] -= 1
                else:
                    lst[e+1] += 1
                    lst[e+2] += 1
            # else:
            #     while lst[e] > 1:
            #         lst[e] -= 2
            #         if lst[e+1] > 0:
            #             lst[e+1] -= 1
            #         else:
            #             lst[e+1] += 1
            #             lst[e+2] += 1

    flag = False
    for s in "".join(map(str, reversed(lst))):
        if not flag and s=="0":
            continue
        else:
            flag = True
            print(s, end="")
    print()
else:
    b = bin(N)[3:]
    lst = [0 for _ in range(100)]
    for e,s in enumerate(reversed(b)):
        if e % 2 == 0:
            lst[e] += int(s)
            lst[e+1] += int(s)
        else:
            lst[e] += int(s)


    for e,s in enumerate(lst):
        if s >= 2:
            while lst[e] > 1:
                lst[e] -= 2
                if lst[e+1] > 0:
                    lst[e+1] -= 1
                else:
                    lst[e+1] += 1
                    lst[e+2] += 1

    flag = False


    for s in "".join(map(str, reversed(lst))):
        if not flag and s == "0":
            continue
        else:
            flag = True
            print(s, end="")
    print()

# print("".join(map(str, reversed(lst))))
from collections import deque

H,W=map(int,input().split())
grid=[input() for i in range(H)]
dist=[[-1]*W for _ in range(H)]

M=deque()
for i in range(W):
    for j in range(H):
        if grid[i][j]=="#":
            M.append((i,j))
            dist[i][j]=0

def bfs(M,dist):
    d=0
    while M:
        x,y=M.popleft()
        d=dist[x][y]
        for dx,dy in ((1,0),(0,1),(-1,0),(0,-1)):
            new_h=x+dy
            new_w=y+dx
            if new_h < 0 or H <= new_h or new_w <0 or W <= new_w:
                continue
            if dist[new_h][new_w] == -1:
                dist[new_h][new_w]=d+1
                M.append((new_h,new_w))
    return d

d=bfs(M,dist)
print(d)



### FIXED CODE ###

from collections import deque

H,W=map(int,input().split())
grid=[input() for i in range(H)]
dist=[[-1]*W for _ in range(H)]

black_cells=deque()
for h in range(H):
    for w in range(W):
        if grid[h][w] == "#":
            black_cells.append((h,w))
            dist[h][w]=0

def bfs(black_cells,dist):
        d=0
        while black_cells:
            h,w=black_cells.popleft()
            d=dist[h][w]
            for dx, dy in ((1,0),(0,1),(-1,0),(0,-1)):
                new_h=h+dy
                new_w=w+dx
                if new_h <0 or H <= new_h or new_w < 0 or W<=new_w:
                    continue
                if dist[new_h][new_w]==-1:
                    dist[new_h][new_w]=d+1
                    black_cells.append((new_h,new_w))
        return d

d=bfs(black_cells,dist)
print(d)
n,k=input().split()
ans=n-k+1

### FIXED CODE ###

n,k=map(int,input().split())
print(n-k+1)
x500 = int(input())
x100 = int(input())
x50 = int(input())
xxx = int(input())

i = 0
j = 0
k = 0

count = 0
for i in x500:
    if total(i, j, k) == xxx:
        count += 1
    for j in x100:
        if total(i, j, k) == xxx:
            count += 1
        for k in x50:
            if total(i, j, k) == xxx:
                count += 1
print(count)


def total(i, j, k):
    return 500 * i + 100 * j + 50 * k

### FIXED CODE ###

A, B, C, x = [int(input()) for i in range(4)]
print(sum(500 * a + 100 * b + 50 * c == x for a in range(A+1) for b in range(B+1) for c in range(C+1)))
import sys
import re
import queue
import collections
import math
import sympy
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []


def main():
	N = i_input()
	sum = 0
	for i in range(1,N):
		sum += (N-1) // i

	print(sum)

	return

if __name__ == '__main__':
	main()

### FIXED CODE ###

import sys
import re
import queue
import collections
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []


def main():
	N = i_input()
	sum = 0
	for i in range(1,N):
		sum += (N-1) // i

	print(sum)

	return

if __name__ == '__main__':
	main()
a=int(input());b=int(input());c=int(input());d=int(input());print(min(a,b)+min(c+d))

### FIXED CODE ###

print(min(int(input()),int(input()))+min(int(input()),int(input())))
S = list(input())
L = len(S)

if L != 26:
  # まだ使ってないもので、最大ものもを最後につける
  USED = [False] * 26
  for s in S:
    USED[ord(s) - 97] = True
  
  for i in range(26):
    if not USED[i]:
      S.append(chr(97+i))
      break
  
  print("".join(S))
else:
  # 26文字ある場合
  prev = -1
  k = -1
  USED = []
  for i in range(26)[::-1]:
    d = ord(S[i]) - 97
    if prev < d:
      prev = d
      USED.append(S[i])
    else:
      k = i
      break
  
  if K == -1:
    print(-1)
    exit()
  
  S = S[:k] + min(USED)
  print("".join(S))


### FIXED CODE ###

S = list(input())
L = len(S)

if L != 26:
  # まだ使ってないもので、最大ものもを最後につける
  USED = [False] * 26
  for s in S:
    USED[ord(s) - 97] = True
  
  for i in range(26):
    if not USED[i]:
      S.append(chr(97+i))
      break
  
  print("".join(S))
else:
  # 26文字ある場合
  prev = -1
  k = -1
  USED = []
  for i in range(26)[::-1]:
    d = ord(S[i]) - 97
    if prev < d:
      prev = d
      USED.append(S[i])
    else:
      k = i
      break
  
  if k == -1:
    print(-1)
  else:  
    nxt = min([s for s in USED if s > S[k]])
    S = S[:k] + [nxt]
    print("".join(S))