Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

N=int(input())
S=input()


num=S.count("#")
if num>S.count("."):#全部黒にする
  num=S.count(".")
  
for i in range(0,N): #i番目まで白
  n=S.count("#",0,i)+S.count(".",i+1,N)

  if n<num:
    num=n
 
print(num)

### FIXED CODE ###

N=int(input())
S=input()


num=S.count("#")
if num>S.count("."):#全部黒にする
  num=S.count(".")
  
  
c_w=0
c_b=S.count(".")

for i in range(0,N): #i番目まで白
  if S[i]=="#":
    c_w+=1
  else:
    c_w=c_w
    c_b-=1
  num=min(num,c_w+c_b)
 
print(num)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
n,k = map(int,input().split())
edge = [[] for i in range(n)]
alledge = []
for i in range(n-1):
    a,b = map(int,input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
    alledge.append([a-1,b-1])
if n==2:
    print(0)
    exit()


def f(x,y,c):
    c += 1
    for e in edge[x]:
        if e != y:
            if c > d:
                tmp[0] +=1
            f(e,x,c)

sys.setrecursionlimit(5000000)

if k % 2 == 0:
    d = k//2
    ass = 10**9
    tmp = [0]
    for i in range(n):
        tmp[0] = 0
        f(i,-1,0)
        ass = min(ass,tmp[0])
    print(ass)
else:
    d = (k-1)//2
    ass = 10**9
    tmp = [0]
    for e1 in alledge:
        tmp[0] = 0
        f(e1[0],e1[1],0)
        f(e1[1],e1[0],0)
        ass = min(ass,tmp[0])
    print(ass)

### FIXED CODE ###

import sys
#input = sys.stdin.readline
n,k = map(int,input().split())
edge = [[] for i in range(n)]
alledge = []
for i in range(n-1):
    a,b = map(int,input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
    alledge.append((a-1,b-1))

def f(x,y,c):
    global tmp
    c += 1
    for e in edge[x]:
        if e == y:
            continue
        if c > d:
            tmp +=1
        f(e,x,c)

sys.setrecursionlimit(4100000)

if k % 2 == 0:
    d = k//2
    ass = 2001
    for i in range(n):
        tmp = 0
        f(i,-1,0)
        ass = min(ass,tmp)
    print(ass)
else:
    d = (k-1)//2
    ass = 2001
    for e1 in alledge:
        tmp = 0
        f(e1[0],e1[1],0)
        f(e1[1],e1[0],0)
        ass = min(ass,tmp)
    print(ass)
### BUGGY CODE ###

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

for i in range(N):
    print(max(A[:i] + A[i+1:]))

### FIXED CODE ###

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

max_num = max(A)
a = sorted(A)
second = a[-2]

for i in range(N):
    if A[i] == max_num:
        print(second)
    else:
        print(max_num)
### BUGGY CODE ###

n = int(input())
result = []
for a in range(n):
    c = input().split()
    if c[0] == 'insert':
        result.append(int(c[1]))
    elif c[0] == 'delete':
        c[1] = int(c[1])
        if c[1] in result:
            if result.count(c[1]) == 1:
                result.remove(c[1])
            else:
                for i in range(len(result)-1, -1, -1):
                    if result[i] == c[1]:
                        del result[i]
                        break
        else:
            continue
    elif c[0] == 'deleteFirst':
        del result[-1]
    else:
        del result[0]

for i in range(len(result)-1, -1, -1):
    if i == 0:
        print(result[i])
    else:
        print(result[i], end=' ')


### FIXED CODE ###

from collections import deque
import sys

n = int(input())
result = deque()
func = {'insert':result.appendleft,\
        'delete':result.remove,\
        'deleteFirst':result.popleft,\
        'deleteLast':result.pop}

for line in sys.stdin.readlines():
    c = line.split()
    if len(c) > 1:
        try:
            func[c[0]](int(c[1]))
        except:
            continue
    else:
        func[c[0]]()

print(*result)
### BUGGY CODE ###

n = int(input())
s = input()

r = len(s.replace('G','').replace('B',''))
g = len(s.replace('R','').replace('B',''))
b = len(s.replace('G','').replace('R',''))

ans = r*g*b

for i in range(n):
  for j in range(n):
    if i+j+j+2 >= n:
      break
    
    if (not s[i] == s[i+j+1]) and (not s[i+j+1] == s[i+j+j+2]) and (not s[i+j+j+2] == s[i]):
      ans -= 1
      
print(ans)

### FIXED CODE ###

n = int(input())
s = input()

r = len(s.replace('G','').replace('B',''))
g = len(s.replace('R','').replace('B',''))
b = len(s.replace('G','').replace('R',''))

ans = r*g*b

for i in range(n):
  for j in range(n):
    if i+j+j+2 >= n:
      break
    
    if (not s[i] == s[i+j+1]) and (not s[i+j+1] == s[i+j+j+2]) and (not s[i+j+j+2] == s[i]):
      ans -= 1
      
print(ans)
### BUGGY CODE ###

n=int(input())
slist=[]
for i in range(n):
    s10=input()
    si=[]
    for ii in range(10):
        si.append(s10[ii])
    si.sort()
    stmp=""
    for ii in range(10):
        stmp=stmp+si[ii]
    slist.append(stmp)
    
icnt=0    
for i in range(n):
    for j in range(i+1,n):
        if slist[i]==slist[j]:
            icnt=icnt+1
            
print(icnt)            

### FIXED CODE ###

n=int(input())
slist=[]
for i in range(n):
    s10=input()
    si=[]
    for ii in range(10):
        si.append(s10[ii])
    si.sort()
    stmp=""
    for ii in range(10):
        stmp=stmp+si[ii]
    slist.append(stmp)
slist.sort()
    
icnt=0   
i=0 
while i<=n-2:
    j=i+1
    jcnt=0
    while slist[i]==slist[j]:
        jcnt=jcnt+1
        icnt=icnt+jcnt
        j=j+1
        if j>=n:
            break
    i=j
    if i>=n-1:
        break
            
print(icnt)
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
A.sort()
b = [False] * len(A)

for i in range(N):
  for j in range(N):
    if b[j] or i == j:
      continue
    if A[j] % A[i] == 0:
      b[j] = True

# print(b)

print(len(tuple(filter(lambda x: x == False, b))))


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
A.sort()
M = A[-1]
b = [True] * (M + 1)

count = 0
for i, a in enumerate(A):
  if not b[a]:
    continue
  for j in range(a, M+1, a):
    b[j] = False
  if i < N-1 and A[i+1] == a:
    continue
  count += 1

print(count)
### BUGGY CODE ###

n = int(input())
s = str(input())

R, G, B = [], [], []
for i, c in enumerate(s):
  if c == 'R': R.append(i)
  elif c == 'G': G.append(i)
  else: B.append(i)

ans = 0
for r in R:
  for g in G:
    if r < g: x, y = r, g
    else: x, y = g, r
    ans += len(B)
    if x*2 - y >= 0:
      if x*2 - y in B: ans -= 1
    if (x + y) % 2 == 0:
      if (x+y)//2 in B: ans -= 1
    if y*2 - x in B: ans -= 1

print(ans)

### FIXED CODE ###

n = int(input())
s = str(input())

R, G, B = [], [], []
for i, c in enumerate(s):
  if c == 'R': R.append(i)
  elif c == 'G': G.append(i)
  else: B.append(i)

ans = 0
for r in R:
  for g in G:
    if r < g: x, y = r, g
    else: x, y = g, r

    ans += len(B)
    if x*2 - y >= 0:
      if s[x*2 - y] == 'B': ans -= 1
    if (x + y) % 2 == 0:
      if s[(x+y)//2] == 'B': ans -= 1
    if y*2 - x < len(s):
      if s[y*2 - x] == 'B': ans -= 1

print(ans)
### BUGGY CODE ###

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

ans=sum(A)
for a in range(3,N):
  for b in range(2,a):
    for c in range(1,b):
      sum1=sum(A[:c])
      sum2=sum(A[c:b])
      sum3=sum(A[b:a])
      sum4=sum(A[a:])
      dif=max(sum1,sum2,sum3,sum4)-min(sum1,sum2,sum3,sum4)
      if dif<ans:
        ans=dif
      if sum2<=sum1:
        break
    if min(sum1,sum2,sum3)==sum3:
      break
  if min(sum1,sum2,sum3,sum4)==sum4:
    break

print(ans)

### FIXED CODE ###

from bisect import bisect_left, bisect_right
from itertools import accumulate

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

ans=A_sum[N-1]
for m in range(2,N-1):
  sum_left=A_sum[m-1]
  i=bisect_left(A_sum,sum_left/2)
  sum1=A_sum[i]
  if i!=0:
    if A_sum[i]+A_sum[i-1]>sum_left:
      sum1=A_sum[i-1]
  sum2=sum_left-sum1

  sum_right=A_sum[N-1]-sum_left
  i=bisect_left(A_sum,sum_left+sum_right/2)
  sum3=A_sum[i]-sum_left
  if i!=m:
    if A_sum[i]+A_sum[i-1]-2*sum_left>sum_right:
      sum3=A_sum[i-1]-sum_left
  sum4=sum_right-sum3
  max_sum=max(sum1,sum2,sum3,sum4)
  min_sum=min(sum1,sum2,sum3,sum4)
  dif=max_sum-min_sum
  if dif<ans:
    ans=dif

print(ans)
### BUGGY CODE ###

import bisect
a,b,q = map(int,input().split())
s = [-10**11]+[int(input()) for _ in range(a)]+[10**11]
t = [-10**11]+[int(input()) for _ in range(b)]+[10**11]
for i in range(q):
  ans = 10**11
  x = int(input())
  l = bisect.bisect(s,x)
  m = bisect.bisect(t,x)
  arr = [[s[l-1],s[l]],[t[m-1],t[m]]]
  for i in range(4):
    S = 0
    now = x
    for j in range(2):
      S += abs(now-arr[j][i >> j & 1])
      now = arr[j][i >> j & 1]
    ans = min(ans,S)
  for i in range(4):
    S = 0
    now = x
    for j in range(2):
      S += abs(now-arr[1-j][i >> j & 1])
      now = arr[1-j][i >> j & 1]
    ans = min(ans,S)
  print(ans)


### FIXED CODE ###

import bisect
a,b,q = map(int,input().split())
s = [-10**11]+[int(input()) for _ in range(a)]+[10**11]
t = [-10**11]+[int(input()) for _ in range(b)]+[10**11]
for i in range(q):
  ans = 10**11
  x = int(input())
  l = bisect.bisect(s,x)
  m = bisect.bisect(t,x)
  arr = [[s[l-1],s[l]],[t[m-1],t[m]]]
  for i in range(4):
    S = 0
    now = x
    for j in range(2):
      t0 = now-arr[j][i >> j & 1]
      S += t0*((-1)**(t0<0))
      now -= t0
    if ans > S:
      ans = S
  for i in range(4):
    S = 0
    now = x
    for j in range(2):
      t0 = now-arr[1-j][i >> j & 1]
      S += t0*((-1)**(t0<0))
      now -= t0
    if ans > S:
      ans = S
  print(ans)
### BUGGY CODE ###

N,x,y=map(int,input().split())
dp=[[abs(i-k) for k in range(N)]for i in range(N)]
dp[x-1][y-1]=1
dp[y-1][x-1]=1
for k in [x-1,y-1]:
    for i in range(N):
        for j in range(N):
            dp[i][j]=min(dp[i][j],dp[i][k]+dp[k][j],abs(i-j))

cnt={}
for k in range(N):
    for i in range(N):
        if dp[k][i] in cnt:
            cnt[dp[k][i]]+=1
        else:
            cnt[dp[k][i]]=1

for i in range(1,N):
    try :
        print(cnt[i]//2)
    except:
        print(0)

### FIXED CODE ###

N,x,y=map(int,input().split())
dp=[[abs(i-k) for k in range(N)]for i in range(N)]
dp[x-1][y-1]=1
dp[y-1][x-1]=1
for k in [x-1,y-1]:
    for i in range(N):
        for j in range(N):
            dp[i][j]=min(dp[i][j],dp[i][k]+dp[k][j],abs(i-j))

cnt={}
for k in range(N):
    for i in range(N):
        if dp[k][i] in cnt:
            cnt[dp[k][i]]+=1
        else:
            cnt[dp[k][i]]=1

for i in range(1,N):
    try :
        print(cnt[i]//2)
    except:
        print(0)
### BUGGY CODE ###

import statistics
n = int(input())
x = list(map(int, input().split()))
for i in range(n):
    print(statistics.median(x[:i]+x[i+1:]))

### FIXED CODE ###

import statistics
n = int(input())-1
a = list(map(int, input().split()))
N = sorted([[x,y] for y, x in enumerate(a)])

ans = [0] * (n+1)
for i in range(n+1):
    if i < n//2+1: 
        ans[N[i][1]] = N[n//2+1][0]
    else: ans[N[i][1]] = N[n//2][0]
for x in ans: print(x)
### BUGGY CODE ###

N, A, B = list(map(int, input().split()))
n = A - B
h = [int(input()) for i in range(N)]
count = 0
while len(h) > 0:
	count += 1
	max_n = max(h)
	idx = h.index(max_n)

	h[idx] -= n
	h = list(map(lambda x: x-B, h))
	h = list(filter(lambda x: x > 0, h))
	
print(count)

### FIXED CODE ###

import numpy as np

N, A, B = list(map(int, input().split()))
h = np.array([int(input()) for i in range(N)], dtype='int64')

left, right = 0, np.ceil(np.max(h)/B)

while left+1 < right:
    mid = np.ceil((left + right) / 2)
    x = h - mid*B
    x[x<0] = 0
    x = np.ceil(x / (A - B))

    if np.sum(x) <= mid:
        right = mid
    else:
        left = mid

print(int(right))
### BUGGY CODE ###

import sys
import math
from copy import deepcopy
from collections import deque, defaultdict
from operator import mul
from functools import reduce
sys.setrecursionlimit(20000000)

input = sys.stdin.readline


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

    if N == 1:
        print(math.floor(stuff[0] / (2**M)))
        sys.exit()

    for i in range(M):
        stuff[stuff.index(max(stuff))] = math.floor(stuff[stuff.index(max(stuff))] / 2)

    print(sum(stuff))


if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
import math
from copy import deepcopy
from collections import deque, defaultdict
from heapq import heappush, heappop
from operator import mul
from functools import reduce
sys.setrecursionlimit(20000000)

input = sys.stdin.readline


def main():
    N, M = map(int, input().split())
    stuff = []
    for x in input().split():
        heappush(stuff, -int(x))

    for i in range(M):
        heappush(stuff, -math.floor(-heappop(stuff) / 2))

    print(-sum(stuff))


if __name__ == '__main__':
    main()
### BUGGY CODE ###

N, K = map(int,input().split())
LR = [tuple(map(int,input().split())) for _ in range(K)]
d = [0]*N
ans = [0]*N
ans[0] = 1
for i in range(N):
    x = ans[i]
    for k in range(K):
        L, R = LR[k]
        if i+L < len(d):
            d[i+L] += x
        if i+R+1 < len(d):
            d[i+R+1] -= x
    for j in range(i+2, len(d)):
        d[j] += d[j-1]
    for j in range(len(d)):
        ans[j] += d[j]
        d[j] = 0
print(ans[-1] % 998244353)

### FIXED CODE ###

N, K = map(int,input().split())
LR = [tuple(map(int,input().split())) for _ in range(K)]
d = [0]*N
d[0] = 1
MOD = 998244353
for i in range(N-1):
    x = d[i]
    d[0] = 0
    for k in range(K):
        L, R = LR[k]
        if i+L < len(d):
            d[i+L] += x
            d[i+L] %= MOD
        if i+R+1 < len(d):
            d[i+R+1] -= x
            d[i+R+1] %= MOD
    d[i+1] += d[i]
    d[i+1] %= MOD
print(d[-1] % MOD)
### BUGGY CODE ###

N = int(input())
S = input()        

ans = N
Q = [[i] for i in range(N)] 
L = 2
while Q and L<27:
    Q_tmp = []
    for q in Q:
        tmp = ""
        for c in q:
            tmp += S[c]
        for i in range(q[-1]+1,N):
            if not(S[i] in tmp):
                Q_tmp.append(q+[i])
                ans += 1
        ans %= 10**9+7
    Q = Q_tmp
    L += 1
print(ans)  


### FIXED CODE ###

N = int(input())
S = input()        

tmp = []
for a in "abcdefghijklmnopqrstuvwxyz":      
    tmp.append(S.count(a)+1)
    
ans = 1 
for i in tmp:
    ans = ans * i % (10**9+7)
    
print(ans-1)
### BUGGY CODE ###

n = int(input())
s = input()
answer = n
for i in range(n):
  total = s[i+1:].count('E') + s[:i].count('W')
  answer = min(answer, total)
print(answer)

### FIXED CODE ###

n = int(input())
s = input()
answer = total = s.count('E')
for i in range(n):
  if s[i] == 'E':
    total -= 1
  else:
    total += 1
  answer = min(answer, total)
print(answer)
### BUGGY CODE ###

from collections import Counter

def s_in():
    return input()

def n_in():
    return int(input())

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

class Interval():
    def __init__(self, li):
        self.li = li
        self.n = len(li)
        self.sum_li = [li[0]]
        for i in range(1, self.n):
            self.sum_li.append(self.sum_li[i-1] + li[i])

    def sum(self, a, b=None):
        if b is None:
            return self.sum(0, a)

        res = self.sum_li[min(self.n-1, b-1)]
        if a > 0:
            res -= self.sum_li[a-1]
        return res


N = n_in()
S = []
counter = Counter()

for i in range(N):
    counter[s_in()] += 1


for s in sorted((map(lambda a: a[0], filter(lambda a: a[1] == counter.most_common()[0][1],  counter.most_common())))):
    print(s)



### FIXED CODE ###

from collections import Counter

def s_in():
    return input()

def n_in():
    return int(input())

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

class Interval():
    def __init__(self, li):
        self.li = li
        self.n = len(li)
        self.sum_li = [li[0]]
        for i in range(1, self.n):
            self.sum_li.append(self.sum_li[i-1] + li[i])

    def sum(self, a, b=None):
        if b is None:
            return self.sum(0, a)

        res = self.sum_li[min(self.n-1, b-1)]
        if a > 0:
            res -= self.sum_li[a-1]
        return res


N = n_in()
S = []
counter = Counter()

for i in range(N):
    counter[s_in()] += 1


t = counter.most_common()[0][1]
for s in sorted((map(lambda a: a[0], filter(lambda a: a[1] == t,  counter.most_common())))):
    print(s)
### BUGGY CODE ###

n = int(input())
A = list(map(int, input().split()))
counter = [0]*n
for i in range(n):
    counter[A[i]-1] += 1

for i in range(n):
    counter_copy = counter.copy()
    if counter_copy[A[i]-1]>1:
        counter_copy[A[i]-1] -= 1
    x = list(map(lambda y: int(y*(y-1)/2), counter_copy))
    print(sum(x))
    

### FIXED CODE ###

from collections import Counter

n = int(input())
A = list(map(int, input().split()))
counter = Counter(A)
counter_comb = list(map(lambda y: int(y*(y-1)/2), counter.values()))
sum_counter = sum(counter_comb)
for i in range(n):
    z = counter[A[i]]
    if z>0:
        print(sum_counter-(z-1))
    else:
        print(sum_counter)
### BUGGY CODE ###

n = int(input())
l = 0
r = n-1
print(0)
s = str(input())
if s == 'Vacant':
    exit()
else:
    sl = s

while l+1 < r:
    c = (l+r)//2
    print(c)
    s = str(input())
    if s == 'Vacant':
        exit()
    else:
        if s == sl:
            l = c
            sl = s
        else:
            r = c

### FIXED CODE ###

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

    def q(i):
        print(i, )
        s = str(input())
        if s == 'Vacant':
            exit()
        else:
            return s

    x = q(n-1)
    x = q(0)

    def ok(m):
        if m == 0:
            return False
        else:
            if (m%2 == 0 and q(m) != x) or (m%2 == 1 and q(m) == x):
                return True
            else:
                return False

    l = 0
    r = n-1
    while l+1 < r:
        c = (l+r)//2
        if ok(c):
            r = c
        else:
            l = c

if __name__ == '__main__':
    main()
### BUGGY CODE ###

from collections import deque


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

dic = {}

for i in range(M):

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

    a -= 1
    b -= 1

    if a not in dic:
        dic[a] = []

    dic[a].append([b,c])

lis = [[0] * N for j in range(N)]
lis[0][0] = 1
lmax = [0] * N
lmax[0] = 1

mcost = [-1 * float("inf")] * N
mcost[0] = 0

q = deque([])
q.append(0)

while len(q) > 0:

    now = q.pop()

    if now not in dic or lmax[now] > N:
        continue

    for npath in dic[now]:

        b = npath[0]
        c = npath[1]

        if mcost[now] + c > mcost[b]:
            mcost[b] = mcost[now] + c
            lis[b] = lis[now].copy()
            lmax[b] = lmax[now]
            lis[b][b] += 1
            lmax[b] = max(lmax[b],lis[b][b])
            q.append(b)

    if lis[N-1][N-1] != -1 * float("inf") and lmax[N-1] >= 2:
        mcost[N-1] = float("inf")
        break

print (mcost[N-1])


### FIXED CODE ###

from collections import deque


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

dic = {}

for i in range(M):

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

    a -= 1
    b -= 1

    if a not in dic:
        dic[a] = []

    dic[a].append([b,c])

lis = [[0] * N for j in range(N)]
lis[0][0] = 1
lmax = [0] * N
lmax[0] = 1

mcost = [-1 * float("inf")] * N
mcost[0] = 0

q = deque([])
q.append(0)
cnt = 0

while len(q) > 0:

    now = q.pop()

    if now not in dic or lmax[now] > N:
        continue

    for npath in dic[now]:

        b = npath[0]
        c = npath[1]

        if mcost[now] + c > mcost[b]:
            mcost[b] = mcost[now] + c
            lis[b] = lis[now].copy()
            lmax[b] = lmax[now]
            lis[b][b] += 1
            lmax[b] = max(lmax[b],lis[b][b])

            if lmax[b] >= 2:
                mcost[b] = float("inf")
            q.append(b)

    if lis[N-1][N-1] != -1 * float("inf") and lmax[N-1] >= 2:
        mcost[N-1] = float("inf")
        break

    elif mcost[N-1] == float("inf"):
        break

print (mcost[N-1])
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**6)

n, q = map(int, input().split())

edges = [[] for _ in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    edges[a-1].append(b-1)
    edges[b-1].append(a-1)

operations = [0] * n
for i in range(q):
    p, x = map(int, input().split())
    operations[p-1] += x

counter = [-1] * n


def calculate(p, i, v):
    total = operations[i] + v
    for c in edges[i]:
        if c != p:
            calculate(i, c, total)
    counter[i] = total


calculate(-1, 0, 0)
print(' '.join(list(map(str, counter))))

### FIXED CODE ###

from collections import deque


def main():
    n, q = map(int, input().split())

    edges = [[] for _ in range(n)]
    for i in range(n-1):
        a, b = map(int, input().split())
        edges[a-1].append(b-1)
        edges[b-1].append(a-1)

    operations = [0] * n
    for i in range(q):
        p, x = map(int, input().split())
        operations[p-1] += x

    counter = [-1] * n
    d = deque([(-1, 0, 0)])
    while len(d) > 0:
        p, i, v = d.pop()
        total = operations[i] + v
        for c in edges[i]:
            if c != p:
                d.append((i, c, total))
        counter[i] = total

    print(*counter)


main()
### BUGGY CODE ###

n = int(input())
x = 0
for a in range(1, n):
  for b in range(1, n):
    if a * b < n:
      x += 1
    elif a * b >= n:
      break
print(x)

### FIXED CODE ###

n = int(input())
x = 0
for a in range(1, n):
  for b in range(1, n):
    if a * b < n:
      x += 1
    elif a * b >= n:
      break
print(x)
### BUGGY CODE ###

import sys
input = sys.stdin.readline

N_ken,M_si = map(int,input().split())
ken_year_map = {}
ken_list = []
year_list = []

for si in range(1,M_si+1):
    ken,year = map(int,input().split())
    ken_list.append(ken)
    year_list.append(year)
    if ken in ken_year_map:
        ken_year_map[ken].append(year)
    else:
        ken_year_map[ken] = [year]
for i in ken_year_map:
    ken_year_map[i].sort()

for ken,year in zip(ken_list,year_list):
    print((str(ken*1000000 + ken_year_map[ken].index(year)+1)).zfill(12))


### FIXED CODE ###

import sys
input = sys.stdin.readline
import bisect

N_ken,M_si = map(int,input().split())
ken_year_map = {}
for i in range(1,N_ken+1):ken_year_map[i]=[]

ken_list = [0]*M_si
year_list = [0]*M_si

for si in range(M_si):
    ken_list[si],year_list[si] = map(int,input().split())
    ken_year_map[ken_list[si]] += [year_list[si]]
        
for i in ken_year_map:
    ken_year_map[i].sort()

for ken,year in zip(ken_list,year_list):
    print('{:06}{:06}'.format(ken,bisect.bisect_right(ken_year_map[ken], year)))
### BUGGY CODE ###

import sys
input = sys.stdin.readline

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

from queue import Queue
q = Queue()
ans = Queue()

def bfs(b):
    q.put(b)
    ans.put([])

    while q.empty() == False:
        p = q.get()
        a = ans.get()

        if p == []:
            break

        if p[0] != 1:
            continue
            
        for i, pp in enumerate(p):
            if pp == i+1:
                q.put(p[:i]+p[i+1:])
                ans.put(a+[i+1])


    if p == []:
        a = a[::-1]
        for aa in a:
            print(aa)
    else:
        print(-1)


bfs(b)


### FIXED CODE ###

import sys
input = sys.stdin.readline

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

from queue import Queue
q = Queue()
ans = Queue()

import numpy as np
n = np.array(n)


def bfs(b):
    q.put(b)
    ans.put([])

    while q.empty() == False:
        p = q.get()
        a = ans.get()

        if p == []:
            break

        if p[0] != 1:
            continue

        m = len(p)

        for i in range(m-1, -1, -1):
            if p[i] == i+1:
                q.put(p[:i]+p[i+1:])
                ans.put(a+[i+1])
                break


    if p == []:
        a = a[::-1]
        for aa in a:
            print(aa)
    else:
        print(-1)


bfs(b)