Harryxun/stf_run huggingface dataset:
inp =list(map(int,input().split()))
l=inp.sort()
print(l[0],l[1],l[2])

### FIXED CODE ###

inp = list(map(int,input().split()))
inp.sort()
print(inp[0],inp[1],inp[2])
N = input()

a = str(int(N) - int(N[-1]) - 1)
b = '9' * (len(N) - 1)

A = 0
B = 0

for aa in a:
    A += int(aa)
for bb in b:
    B += int(bb)
if int(N[0]) > 1:
    B += int(N[0]) - 1

print(max(A, B))


### FIXED CODE ###

N = input()

if len(N) == 1:
    print(int(N))
    exit()

a = str(int(N) - int(N[-1]) - 1)
b = '9' * (len(N) - 1)

A = 0
B = 0
C = 0

for aa in a:
    A += int(aa)
for bb in b:
    B += int(bb)
if int(N[0]) > 1:
    B += int(N[0]) - 1
for n in N:
    C += int(n)


print(max(A, B, C))
a,b = input().split('\n')
n=int(a)
s=b

if n % 2 == 1:
  print('No')
elif s[n:]!=s[:n]:
  print('No')
else:
  print('Yes')

### FIXED CODE ###

n = int(input())
s = input()
if n % 2:
    print("No")
    exit()
half = s[0:n // 2]
print("Yes" if s == half + half else "No")
n = int(input())
for i in range(7):
  if n < 2 ** i:
    print(2**(i-1))
	break

### FIXED CODE ###

n = int(input())
ans = 1

for i in range(7):
  if n >= 2 ** i:
    ans = 2 ** i
print(ans)
print('YNeos'[input()!=input()[::-1]::2])

### FIXED CODE ###

n=input();print('YNeos'[n!=n[::-1]::2])
sw = input().split()

if sw[0] > w[1]:
    print("safe")
else:
    print("unsafe")

### FIXED CODE ###

sw = input().split()

if int(sw[0]) > int(sw[1]):
    print("safe")
else:
    print("unsafe")
a, b = map(int, input().split())
if (a < b):
	print(???a>b???)
elif (a > b):
	print(???a>b???)
else:
	print(???a==b???)

### FIXED CODE ###

a, b = map(int, input().split())
if (a > b):
	print("a > b")
elif (a < b):
	print("a < b")
elif (a == b):
	print("a == b")
z = list(map(int, input().split()))
x = z[0]
p = list(map(int, input().split()))
count = 0
l = []
for i in range(1, 101):
  l.append(i)
for i in p:
  l.remove(i)
t = 200
for i in l:
  e = abs(x-i)
  if e >= t:
    break
  t = e
  ans = i
print(ans)

### FIXED CODE ###

z = list(map(int, input().split()))
x = z[0]
if z[1] == 0:
  print(x)
else:
  p = list(map(int, input().split()))
  l = []
  for i in range(-1, 102):
    l.append(i)
  for i in p:
    l.remove(i)
  t = 200
  for i in l:
    e = abs(x-i)
    if e >= t:
      break
    t = e
    ans = i
  print(ans)
import sys
A = input()
N = len(A)
B = [0] * len(A)
k = 0
tmp= 0
for i in range(len(A)):
    if A[i] == 'R':
        tmp += 1
        for j in range(i+1,N):
            if A[j] == 'R':
                tmp += 1
            else:
                k = j
                break
        if tmp % 2 ==0:
            B[k] += 1
        else:
            B[k-1] += 1
        tmp = 0
    else:
        tmp += 1
        for j in range(1,i)[::-1]:
            if A[j] == 'L':
                tmp += 1
            else:
                k = j
                break
        if tmp % 2 ==0:
            B[k] += 1
        else:            
            B[k+1] += 1
        tmp = 0
L = [str(i) for i in B]
L = " ".join(L)
print(L)

### FIXED CODE ###

import sys,fractions
a = input()
n = len(a)
t = []
ans = [0] * n
cnt = 0
tmp = a[0]
for i in range(n):
    if a[i] == tmp:
       cnt += 1 
    else:
        t.append(cnt)
        tmp = a[i]
        cnt = 1
t.append(cnt)
N = len(t)
len = 0
for i in range(N)[::2]:
    tmp_len = t[i] + t[i+1]
    #R
    ans[len + t[i] - 1] += int((t[i]+1)/2)
    ans[len + t[i]] += int(t[i]/2)
    #L
    ans[len + t[i] - 1] += int(t[i+1]/2)
    ans[len + t[i]] += int((t[i+1]+1)/2)
    len += tmp_len
L = [str(i) for i in ans]
print(" ".join(L))
import heapq

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

inl = [tuple(map(int, input().split())) for i in range(N)]
inl.sort(reverse=True)

heap = []

res = 0


for i in range(1, 10001):
    nex = set([])
    rem = set([])

    con = 0
    while inl and inl[-1][0] == i:
        s,t,c = inl.pop()
        nex.add((s,c))
        heapq.heappush(heap, (t,c))

    while heap and heap[0][0] == i:
        t1,c1 = heapq.heappop(heap)
        rem.add((t1,c1))

    con = len(heap) + min(len(nex), len(rem))
    res = max(res, con)

print(res)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
MOD = 1000000007
def POW(x, y): return pow(x, y, MOD)
def INV(x, m=MOD): return pow(x, m - 2, m)
def DIV(x, y, m=MOD): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()

N,A,B=LI()

print(min(N*A,B))
import sys
#import numpy as np
def main():
    input = sys.stdin.readline
    N = int(input())
    Hs= list(map(int, input().split()))
    HsProc = Hs.copy()
 
    #proc = np.array(N)
    ans = ""
    for i in range(N):
        #print(Hs)
        h_tmp = Hs[i]
        if i < N - 1:
            h_next = Hs[i + 1]
            if h_tmp < h_next:
                Hs[i+1] -= 1
                pass
            elif h_tmp == h_next:
                pass
            elif h_tmp - 1 == h_next:
                if i > 0:
                    h_before = Hs[i - 1]

                    if h_before <= h_tmp - 1:
                        #proc[i] = 1
                        pass
                    else:
                        ans = "No"
                        break
                elif i == 0:
                    #proc[i] = 1
                    pass
            else:
                ans = "No"
                break
    if ans == "":
        ans = "Yes"

    print(ans)
 
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
def main():
    input = sys.stdin.readline
    N = int(input())
    Hs= list(map(int, input().split()))
    hs = [0]
    ans = ""
    for i in range(N):
        hs.append(0)
        #print(Hs)
        h_tmp = Hs[i]
        if i < N - 1:
            h_next = Hs[i + 1]
            if h_tmp < h_next:
                hs[i + 1] = 1
                Hs[i + 1] -= 1
                pass
            elif h_tmp == h_next:
                pass
            elif h_tmp - 1 == h_next and hs[i] == 0:
                if i > 0:
                    h_before = Hs[i - 1]
                    if h_before <= h_tmp - 1:
                        pass
                    else:
                        ans = "No"
                        break
                elif i == 0:
                    pass
            else:
                ans = "No"
                break
    if ans == "":
        ans = "Yes"
 
    print(ans)
 
if __name__ == '__main__':
    main()
S=input()
if S[0]!="1":
  print(S[0])
else:
  K=int(input())
  i=0
  while S[i]=="1":
    i+=1
  if i<K:
    print(S[i])
  else:
    print(1)

### FIXED CODE ###

S=input()
if all(S[i]=="1" for i in range(len(S))):
  print(1)
elif S[0]!="1":
  print(S[0])
else:
  K=int(input())
  i=0
  while S[i]=="1":
    i+=1
  if i<K:
    print(S[i])
  else:
    print(1)
5
3 10
48 17
31 199
231 23
3 2

### FIXED CODE ###

n = int(input())
L = []
for i in range(n):
	L.append([int(i) for i in input().split()])

x = L[0][0]
y = L[0][1]

for i in range(n-1):
  n = max(-(-x//L[i+1][0]), -(-y//L[i+1][1]))
  x = n*L[i+1][0]
  y = n*L[i+1][1]

print(x+y)
def main():
    input = sys.stdin.readline
    Dy = [0,1,0,-1]
    Dx = [1,0,-1,0]
    H, W, K = map(int, input().split())
    y1,x1,y2,x2 = map(int, input().split())
    C = ["@" + input() for _ in range(H)]
    C = ["@"*(W+2)] + C + ["@"*(W+2)]
    Nexts = [[[1]*(W+2) for _ in range(H+2)] for _ in range(4)]
    q = [(y1, x1)]
    ans = 0
    while q:
        q_new = []
        for y0, x0 in q:
            if (y0, x0) == (y2, x2):
                print(ans)
                exit()
            for dy, dx, Next in zip(Dy, Dx, Nexts):
                y, x = y0, x0
                sum_next = 0
                Path = [(y, x)]
                while True:
                    sum_next += Next[y][x]
                    y = y0 + dy * sum_next
                    x = x0 + dx * sum_next
                    if sum_next > K or C[y][x] != ".":
                        break
                    Path.append((y, x))
                    q_new.append((y, x))
                for path_y, path_x in Path:
                    Next[path_y][path_x] = abs(path_y-y) + abs(path_x-x)
        q = q_new
        ans += 1
    print(-1)

main()


### FIXED CODE ###

Dy = [0,1,0,-1]
Dx = [1,0,-1,0]
H, W, K = map(int, input().split())
y1,x1,y2,x2 = map(int, input().split())
C = ["@" + input() + "@" for _ in range(H)]
C = ["@"*(W+2)] + C + ["@"*(W+2)]
L = [[1]*(W+2) for _ in range(H+2)]
R = [[1]*(W+2) for _ in range(H+2)]
U = [[1]*(W+2) for _ in range(H+2)]
D = [[1]*(W+2) for _ in range(H+2)]
q = [(y1, x1)]
ans = 0
while q:
    q_new = []
    for y0, x0 in q:
        if (y0, x0) == (y2, x2):
            print(ans)
            exit()
        for dy, dx, Next in zip(Dy, Dx, [L, R, U, D]):
            y, x = y0, x0
            sum_next = 0
            Path = [(y, x)]
            while True:
                sum_next += Next[y][x]
                y = y0 + dy * sum_next
                x = x0 + dx * sum_next
                if sum_next > K:
                    break
                if C[y][x] == "@":
                    break
                Path.append((y, x))
                q_new.append((y, x))
            for path_y, path_x in Path:
                Next[path_y][path_x] = abs(path_y-y) + abs(path_x-x)
    q = q_new
    ans += 1

print(-1)
a=input()
b=input()

if a > b :
    print('a > b')
elif a < b :
    print('a < b')
else :
    print('a == b')


### FIXED CODE ###

a,b=map(int,input().split())
if a > b:
    print("a > b")
elif a < b :
    print("a < b")
else:
    print("a == b")
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))


n = int(input())
minsum = [None] * n # (min, sum)
for i in range(n):
    tmp = list(map(int, " ".join(input()).replace("(", "1").replace(")", "-1").split()))
    c = 0
    m = 0
    for item in tmp:
        c += item
        m = min(c, m)
    minsum[i] = (m, sum(tmp))
minsum.sort()

if sum(item[1] for item in minsum)!=0:
    print("No")
else:
    c = 0
    i = n-1
    while True:
        m, s = minsum[i]
        if m<0:
            break
        c += s
        i -= 1
        minsum.pop()
    minsum.sort(key=lambda x: x[1])
#     print(minsum, c)
    i = len(minsum)-1
    update = False
    while minsum:
        m, s = minsum[i]
        if c+m>=0:
            minsum.pop(i)
            update = True
            c += s
        i -= 1
        if i<0:
            if not update:
                print("No")
                break
            i = len(minsum) - 1
    else:
        print("Yes")

### FIXED CODE ###

def main():
    import queue
    import sys
    input = lambda : sys.stdin.readline().rstrip()
    sys.setrecursionlimit(max(1000, 10**9))



    n = int(input())
    minsum = [None] * n # (min, sum)
    for i in range(n):
        tmp = list(map(int, " ".join(input()).replace("(", "1").replace(")", "-1").split()))
        c = 0
        m = 0
        for item in tmp:
            c += item
            m = min(c, m)
        minsum[i] = (m, sum(tmp))
    minsum.sort()

    if sum(item[1] for item in minsum)!=0:
        print("No")
    else:
        minsum1 = [item for item in minsum if item[1]>=0]
        minsum2 = [(item[0]-item[1], -item[1]) for item in minsum if item[1]<0]
        minsum2.sort()
        c = 0
        for m,s in minsum1[::-1]:
            if c+m>=0:
                c += s
            else:
                print("No")
                return
        c = 0
        for m,s in minsum2[::-1]:
            if c+m>=0:
                c+=s
            else:
                print("No")
                return
        print("Yes")
main()
n = int(input())
x = input()
ans = [0]*(-(-n//2)+1)

for i in range(1,-(-n//2)+1):
    s = format(i, 'b')
    c = s.count('1')
    a = i%c
    ans[i] += 1
    ans[i] += ans[a] 

one_cnt = x.count('1')
numx = int(x,2)
for i in range(n):
    temp = one_cnt
    if x[i]=='0':
        temp += 1
        num = numx + 2**(n-1-i)
    else:
        temp -= 1
        num = numx - 2**(n-1-i)
    print(ans[num%temp]+1)


### FIXED CODE ###

n = int(input())
x = input()
ans = [0]*(n+1)

for i in range(1,n+1):
    s = format(i, 'b')
    c = s.count('1')
    a = i%c
    ans[i] += 1
    ans[i] += ans[a] 

one_cnt = x.count('1')
numx = int(x,2)

for i in range(n):
    temp = one_cnt
    if x[i]=='0':
        temp += 1
        num = numx%temp + pow(2,n-1-i,temp)
    else:
        if temp>1:
            temp -= 1
            num = numx%temp - pow(2,n-1-i,temp)
        else:
            print(0)
            continue
    print(ans[num%temp]+1)
x = input()
y = input()

print x * y, (x + y) * 2

### FIXED CODE ###

x = map(int, raw_input().split())

print x[0] * x[1], (x[0] + x[1]) * 2
print(a * b (a * 2) + (b * 2))

### FIXED CODE ###

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

c,d = a * b,(a + b) *2

print(str(c) + " " + str(d))
n = int(input())
a = list(map(int,input().split()))

num = 1
ans = 0

if i in range(n):
  if num == a[i]:
    num += 1

if num == 1:
  ans = -1
else:
  ans = n - num + 1

print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
 
num = 1
ans = 0
 
for i in range(n):
  if num == a[i]:
    num += 1
 
if num == 1:
  ans = -1
else:
  ans = n - num + 1
 
print(ans)
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0:
        cnt+=1
        temp //= i
        arr.append([i, cnt])

  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])

  return arr

i = int(input())
a = factorization(i)
for i in range(len(a)-1):
  if a[i][0] == a[i + 1][0]:
    a.remove(a[i])
flag = False
for i in a:
  
  if i[1] == 1:
    
    flag = True
  else:
    flag = False

if flag:
  b = [0 if i % 2 == 0 else 1 for i in range(len(a))]
else:
  b = [i[1]//2 for i in a]

c = [a[i][1]-b[i] for i in range(len(b))]

d = [a[i][0]**b[i] for i in range(len(a))]


f = 1
for i in range(len(c)):
  f *= a[i][0]**c[i]

g = 1
for i in range(len(c)):
  g *= d[i]

print(f + g - 2)

### FIXED CODE ###

a = int(input())

for i in range(int(a**0.5),0,-1):
    if a % i == 0:
        print(int(a/i + i -2))
        break
N=int(input())
T,A=int(input())
H=list(map(int,input().split()))
li=[]

s=li.append(abs(A-(T-0.006*H)))

print(s.index(min(s))+1)

### FIXED CODE ###

N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
li=[]
for h in H:
    li.append(abs(A-(T-0.006*h)))
print(li.index(min(li))+1)
n,k = map(int,input().split())
c = [int(input()) for _ in range(n)]

c.sort()

ans = []
for i in range(n-k+1):
    ans.append(max(c[i:k+i])-min(c[i:k+i])))

print(min(ans))

### FIXED CODE ###

n,k = map(int,input().split())
c = [int(input()) for _ in range(n)]
c.sort()
ans = []
for i in range(n-k+1):
    ans.append(c[i+k-1]-c[i])
print(min(ans))
import sys

s = sys.stdin.read().strip()
words = ["dream", "dreamer", "erase", "eraser"]

def dfs(i):
  for w in words:
    if s.startswith(w, i):
      n = i + len(w)
      if n == len(s):
        print("YES")
        sys.exit(0)
      dfs(n)

dfs(0)
print("NO")


### FIXED CODE ###

import sys

s = sys.stdin.read().strip()
words = ["dream", "dreamer", "erase", "eraser"]

stack = [0]
match = False
while not match and stack:
  i = stack.pop()
  for w in words:
    if s.startswith(w, i):
      n = i + len(w)
      if n == len(s):
        match = True
        break
      stack.append(n)
print("YES" if match else "NO")
n = int(input())
count = 0
for i in range(n):
  d1, d2 = map(int, input().split())
  if count > 2:
    break
  else:
    if d1 == d2:
      count += 1
    else:
      count = 0
if count > 2:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

s = input()
if s[-1] == "s":
  print(s+"es")
else:
  print(s+"s")
n = int(input())
a = int(input())
Max = -200000
Min = a
for i in range(n):
    x = int(input())
    if (Max < x - Min):
        Max = x - Min
    if (x < Min):
        Min = x
print(Max)

### FIXED CODE ###

n = int(input())
a = int(input())
Max = -10 ** 9
Min = a
for i in range(n-1):
    x = int(input())
    if (Max < x - Min):
        Max = x - Min
    if (x < Min):
        Min = x
print(Max)
a, b, c = map(int(input().split()))
if count(7) == 1 and count(5) == 2:
  print('YES')
else:
  print('NO')

### FIXED CODE ###


s = input().split()
if s.count('7') == 1 and s.count('5') == 2:
  print('YES')
else:
  print('NO')
# https://atcoder.jp/contests/abc159/tasks/abc159_e
import sys

ans = sys.maxsize
H, W, K = map(int, input().split())
s = [input() for _ in range(H)]

for h in range(1 << (H - 1)):
    g = 0
    ids = [-1 for _ in range(H)]
    for i in range(H):
        ids[i] = g
        if (h >> i) & 1:
            g += 1

    g += 1
    c = [[[0] * W] for _ in range(g)]
    for i in range(H):
        for j in range(W):
            c[ids[i]][j] = c[ids[i]][j] + (s[i][j] == '1')

    num = g - 1
    now = [0 for _ in range(g)]


    def add(j):
        for i in range(g):
            now[i] += c[i][j]

        for i in range(g):
            if now[i] > K:
                return False

        return True


    if num >= ans:
        continue

    for j in range(W):
        if not add(j):
            num += 1
            if num >= ans:
                continue
            now = [0 for _ in range(g)]
            if not add(j):
                num = sys.maxsize
                break

    ans = min(ans, num)

print(ans)


### FIXED CODE ###

# https://atcoder.jp/contests/abc159/tasks/abc159_e
import sys

ans = sys.maxsize
H, W, K = map(int, input().split())
s = [input() for _ in range(H)]

for h in range(1 << (H - 1)):
    g = 0
    ids = [-1 for _ in range(H)]
    for i in range(H):
        ids[i] = g
        if (h >> i) & 1:
            g += 1

    g += 1
    c = [[0 for _ in range(W)] for _ in range(g)]
    for i in range(H):
        for j in range(W):
            c[ids[i]][j] = c[ids[i]][j] + (s[i][j] == '1')

    num = g - 1
    now = [0 for _ in range(g)]


    def add(j):
        for i in range(g):
            now[i] += c[i][j]

        for i in range(g):
            if now[i] > K:
                return False

        return True

    if num >= ans:
        continue

    for j in range(W):
        if not add(j):
            num += 1
            if num >= ans:
                continue
            now = [0 for _ in range(g)]
            if not add(j):
                num = sys.maxsize
                break

    ans = min(ans, num)

print(ans)
S = int(input())

if S == "SUN":
    print(7)
elif S == "MON":
    print(6)
elif S == "TUE":
    print(5)
elif S == "WED":
    print(4)
elif S == "THU":
    print(3)
elif S == "FRI":
    print(2)
else:
    print(1)

### FIXED CODE ###

S = str(input())

if S == "SUN":
    print(7)
elif S == "MON":
    print(6)
elif S == "TUE":
    print(5)
elif S == "WED":
    print(4)
elif S == "THU":
    print(3)
elif S == "FRI":
    print(2)
else:
    print(1)
import sys

N, M = map(int, input().split())
X = [int(_) for _ in input().split()]

# 座標数よりコマ数が多ければ初期位置で条件を満たす
if N >= M:
    print(0)
    sys.exit()

# ソートする
X.sort()

# 隣り合う数の差を計算する
diff = list()
for m in range(M-1):
    diff.append(X[m+1] - X[m])

total = 0
for n in range(N-1):
    max_index = diff.index(max(diff))
    left = 0
    right = 0
    for l in range(len(diff)):
        if l < max_index:
            left += diff[l]
        elif l > max_index:
            right += diff[l]
    if left > right:
        diff = diff[:max_index]
        total += right
    else:
        diff = diff[max_index+1:]
        total += left

total += sum(diff)
print(total)

### FIXED CODE ###

import sys

N, M = map(int, input().split())
X = [int(_) for _ in input().split()]

# 座標数よりコマ数が多ければ初期位置で条件を満たす
if N >= M:
    print(0)
    sys.exit()

# ソートする
X.sort()

# 隣り合う数の差を計算する
diff = list()
for m in range(M-1):
    diff.append(X[m+1] - X[m])

diff.sort(reverse=True)
print(sum(diff[N-1:]))
H,W = map(int,input().split())
s = [list(input()) for i in range(W)]
for i in range(H):
    for j in range(W):
        if s[i][j] == '#':
            if i == 0:
                if j == 0:
                    if s[i+1][j] != '#' and s[i][j+1] != '#':
                        print('No')
                        exit()
                elif j == W-1:
                    if s[i+1][j] != '#' and s[i][j-1] != '#':
                        print('No')
                        exit()
                else:
                    if s[i+1][j] != '#' and s[i][j-1] != '#' and s[i][j+1] != '#':
                        print('No')
                        exit()
            elif i == H-1:
                if j == 0:
                    if s[i-1][j] != '#' and s[i][j+1] != '#':
                        print('No')
                        exit()
                elif j == W-1:
                    if s[i-1][j] != '#' and s[i][j-1] != '#':
                        print('No')
                        exit()
                else:
                    if s[i-1][j] != '#' and s[i][j-1] != '#' and s[i][j+1] != '#':
                        print('No')
                        exit()
            else:
                if j == 0:
                    if s[i-1][j] != '#' and s[i][j+1] != '#' and s[i+1][j] != '#':
                        print('No')
                        exit()
                elif j == W-1:
                    if s[i-1][j] != '#' and s[i][j-1] != '#' and s[i+1][j] != '#':
                        print('No')
                        exit()
                else:
                    if s[i-1][j] != '#' and s[i][j-1] != '#' and s[i][j+1] != '#' and s[i+1][j] != '#':
                        print('No')
                        exit()
print('Yes')



### FIXED CODE ###

H,W = map(int,input().split())

s=[list(str(input())) for _ in range(H)]

di=[1,-1,0,0]
dj=[0,0,1,-1]
for i in range(H):
    for j in range(W):
        if s[i][j]=='#':
            found=False
            for k in range(4):
                i2=i+di[k]
                j2=j+dj[k]
                if 0<=i2 and i2<H and 0<=j2 and j2<W:
                    if s[i2][j2]=='#':
                        found=True
            if not found:
                print('No')
                exit()

print('Yes')
import sys
from math import ceil
inputs = sys.stdin.readlines()

n, k = map(int, inputs[0].split())
A = list(map(int, inputs[1].split()))

if n == k:
    print(1)
else:
    former = index_min(A)[0]
    latter = n - 1 - former
    ceil(former / (k-1)), ceil(latter / (k-1))
    print(ceil(former / (k-1)) + ceil(latter / (k-1)))

### FIXED CODE ###

import sys
from math import ceil
inputs = sys.stdin.readlines()

n, k = map(int, inputs[0].split())
A = list(map(int, inputs[1].split()))

print(ceil((n-k)/(k-1))+1)
import sys

def main():
    input = sys.stdin.readline

    N = int(input())
    P = list(map(int,input().split()))
'''
    count = 0
    result = list()
    r_apeend = result.append

    for i in range(N):
        Pj = P[0:i+1]
        min_P = min(Pj)
        r_append(min_P)
#        print(min_P)
#        if(P[i] == min_P):
#            count += 1

    print(len(set(result)))
    '''
    count = 0
    flag = True
    
    for i in range(N):
        for j in range(i):
            if(P[i] > P[j]):
                flag = False
                break
        if(flag):
            count += 1
        flag = True
    print(count)

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys

def main():
    input = sys.stdin.readline

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

    #result = list()

    minimum = P[0]
    count = 1
    for i in range(N):
        if(minimum > P[i]):
            minimum = P[i]
            count += 1
    print(count)
#        Pj = list(P[j] for j in range(i+1))
        #print(Pj)
        #Pj = P[0:i+1]
#        min_P = min(Pj)
#        result.append(min_P)
#        print(min_P)
#        if(P[i] == min_P):
#            count += 1

    '''
    count = 0
    flag = True

    for i in range(N):
        for j in range(i):
            if(P[i] > P[j]):
                flag = False
                break
        if(flag):
            count += 1
        flag = True
    print(count)
    '''

if __name__ == "__main__":
    main()