Harryxun/stf_run huggingface dataset:
import numpy as np

n = int(input())
a_list = input().split()
a_list = [int(a) for a in a_list]

b_list = input().split()
b_list = [int(b) for b in b_list]

c_list = input().split()
c_list = [int(c) for c in c_list]

a_ar = np.array(a_list)
b_ar = np.array(b_list)
c_ar = np.array(c_list)

# a_ar.sort()
# b_ar.sort()
# c_ar.sort()

# b_count = []
# for b in b_ar:
#     b_count.append(len(c_ar[c_ar>b]))
b_count_ar = np.sum(b_ar[:,np.newaxis]<c_ar,axis=1)


# b_count_ar = np.array(b_count)

# count = 0
# for a in a_ar:
# count += b_count_ar[np.where(b_ar>a)[0]].sum()
    
print(np.sum((a_ar[:,np.newaxis]<b_ar).astype(int) * b_count_ar))

### FIXED CODE ###

import bisect

n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]

a = sorted(a)
b = sorted(b)
c = sorted(c)

ans = 0

for x in b:
    aa = bisect.bisect_left(a,x)
    cc = len(c) - bisect.bisect_right(c,x)
    ans += aa * cc

print(ans)
al = 'abcdefghijklmnopqrstuvwxy'
c = input()
print(al[al.index(c)+1])

### FIXED CODE ###

al = 'abcdefghijklmnopqrstuvwxyz'
c = input()
print(al[al.index(c)+1])
def func(num,pr):
  global l,ans

  if len(l[num])!=0:
    for z in l[num]:
      if z[0]==pr:
        continue

      if pr==-1:
        ans[z[0]]=z[1]
      else:
        ans[z[0]]=ans[pr]+z[1]
      func(z[0],num)

N=int(input())
l=[ [] for z in range(N)]
ans=[0]*N


for z in range(N-1):
  u,v,w=list(map(int,input().split(" ")))
  l[u-1].append((v-1,w))
  l[v-1].append((u-1,w))

func(0,-1)

for z in ans:
  if z%2==0:
    print(1)
  else:
    print(0)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

def func(num,pr):
  global l,ans

  if len(l[num])!=0:
    for z in l[num]:
      if z[0]==pr:
        continue

      if pr==-1:
        ans[z[0]]=z[1]
      else:
        ans[z[0]]=ans[num]+z[1]
      func(z[0],num)

N=int(input())
l=[ [] for z in range(N)]
ans=[0]*N


for z in range(N-1):
  u,v,w=list(map(int,input().split(" ")))
  l[u-1].append((v-1,w))
  l[v-1].append((u-1,w))

func(0,-1)

#print(l)
#print(ans)


for z in ans:
  if z%2==0:
    print(1)
  else:
    print(0)
a = input()
    b = input()
    number_a = int(a)
    number_b = int(b)
    c = number_a - 2 * number_b
    if c <= 0:
        print(0)
    else:
        print(c)

### FIXED CODE ###

a, b = map(int, input().split())
c = a - 2 * b
if c <= 0:
    print(0)
else:
    print(c)
# 解説を見て解いた。解説PDFの「B≦i≦Wを満たす全てのiについて」のWはW-1の間違い。
def make_table(h, w):

    for i in range(1, h + w - 1):
        fac_table.append(fac_table[-1] * i % mod)  # i! mod 10**9+7
        inv_table.append(pow(fac_table[-1], mod - 2, mod))  # (i!)^(-1) mod 10**9+7.


def comb(n, r):
    return fac_table[n] * inv_table[n - r] * inv_table[r] % mod


def resolve():
    H, W, A, B = map(int, input().split())
    make_table(H, W)
    _sum = 0
    print(
        sum(
            [
                comb(H - A - 1 + i, i) * comb(A - 1 + W - i - 1, A - 1) % mod
                for i in range(B, W)
            ]
        )
        % mod
    )


if __name__ == "__main__":
    resolve()

### FIXED CODE ###

mod = 10 ** 9 + 7
fac_table = [1 for i in range(200001)]
inv_table = [1 for i in range(200001)]


def make_table(h, w):

    for i in range(1, h + w - 1):
        fac_table[i] = fac_table[i - 1] * i % mod
        inv_table[i] = pow(fac_table[i], mod - 2, mod)


def comb(n, r):
    return fac_table[n] * inv_table[n - r] % mod * inv_table[r] % mod


def resolve():
    H, W, A, B = map(int, input().split())
    make_table(H, W)
    print(
        sum(
            [
                comb(H - A - 1 + i, i) * comb(A - 1 + W - i - 1, A - 1) % mod
                for i in range(B, W)
            ]
        )
        % mod
    )

if __name__ == "__main__":
    resolve()
n = int(input())
s = []
for i in range(n):
    s.append(list(str(input())))

def factorial(n):
    res = 1
    for i in range(1, n+1):
        res *= i
    return res

for i in s:
    i.sort()

s.sort()

tmp = 'a'
total = 0
for i in s:
    if i == tmp:
        cnt += 1
    elif cnt >= 2:
        total += factorial(cnt)*factorial(cnt-2)/2
        cnt = 1
    tmp = i

print(int(total))

### FIXED CODE ###

n = int(input())
ss = ["".join(sorted(list(input()))) for _ in range(n)]
ss.sort()

ans = 0
cnt = 0
tmp = ss.pop(0)
for s in ss:
    if tmp == s:
        cnt+=1
    elif cnt > 0:
        tmp = s
        ans+=((cnt+1) * cnt // 2)
        cnt = 0
    else:
        tmp = s
        cnt = 0
print(ans + ((cnt+1) * cnt // 2))
a=input()
print('ABC'a)

### FIXED CODE ###

a=input()
b='ABC'
print(b + a)
N = int(input())
a = list(map(int,input().split()))
ans = a[0]
for i in range(1,N):
  ans = gcd(ans,a[i])
print(ans)

### FIXED CODE ###

import math
N = int(input())
a = list(map(int,input().split()))
ans = a[0]
for i in range(1,N):
  ans = math.gcd(ans,a[i])
print(ans)
N,K=map(int,input().split())
X=list(map(int,input().split()))

cost=10**10
P=X.copy()
i=0
while P[i]<0:
    P.pop(0)
if len(P)>=K:
    cost=P[K-1]    

for i in range(N-K+1):
    if X[i] >= 0:
        break
    else:
        L=[j-X[i] for j in X]
        cost=min(cost,L[i+K-1]+abs(X[i]))

print(cost)

### FIXED CODE ###

N,K=map(int,input().split())
X=list(map(int,input().split()))
X.sort()
ans=10**10

for i in range(N-K+1):
    R=X[i+K-1]
    L=X[i]
    A=[ans, abs(L)+abs(R-L), abs(R)+abs(R-L)]
    ans=min(A)

print(ans)
s = list(input())
t = list(input())

l = []

for i in range(len(s)-len(t) - 1):
    f = True
    for j in range(len(t)):
        if s[i+j] != '?' and s[i+j] != t[j]:
            f = False
            break
    if f:
        a = s[:i] + t + s[:i+len(t)]
        l.append(a.replace('?','a'))
if len(l)>0:
    print(min(l))
else:
    print('UNRESTORABLE')


### FIXED CODE ###

s = input()
t = input()

l = []

for i in range(len(s)-len(t) + 1):
    f = True
    for j in range(len(t)):
        if s[i+j] != '?' and s[i+j] != t[j]:
            f = False
            break
    if f:
        a = s[:i] + t + s[i+len(t):]
        l.append(a.replace('?','a'))
if len(l)>0:
    print(min(l))
else:
    print('UNRESTORABLE')
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
import itertools
from collections import OrderedDict, deque, Counter
from bisect import bisect_left, bisect_right, insort_left, insort_right
sys.setrecursionlimit(10000)


def solve():
    N = int(input())
    A = deque()
    B = deque()
    C = deque()
    A.extend(sorted(list(map(int, input().split(" ")))))
    B.extend(sorted(list(map(int, input().split(" ")))))
    C.extend(sorted(list(map(int, input().split(" ")))))

    while B[0] <= A[0]:
        B.popleft()

    while C[0] <= B[0]:
        C.popleft()

    cnt = 0
    for ele in list((itertools.product(A, B, C))):
        if ele[0] < ele[1] < ele[2]:
            cnt += 1

    print(cnt)
    
    
solve()

### FIXED CODE ###

#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
import math
import itertools
import heapq
import numpy as np
from collections import OrderedDict, deque, Counter
from bisect import bisect_left, bisect_right, insort_left, insort_right
sys.setrecursionlimit(10000)

dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]


def solve():
    N = int(input())
    A = sorted(list(map(int, input().split(" "))))
    B = sorted(list(map(int, input().split(" "))))
    C = sorted(list(map(int, input().split(" "))))

    cnt = 0
    for ele in B:
        cnt += bisect_left(A, ele) * (N - bisect_right(C, ele))

    print(cnt)


solve()
A = list(map(int, input().split()))
Q = int(input())
ans = []
for i in range(Q):
	b, c = list(map(int, input().split()))
	for j in range(N):
		if A[j] == b:
			A[j] = c

	ans += [sum(A)]
[print(a) for a in ans]

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
AA = {}
t = 0
for a in A:
	t += a
	if a in AA:
		AA[a] += 1
	else:
		AA[a] = 1

Q = int(input())
ans = []
for i in range(Q):
	b, c = list(map(int, input().split()))
	if b in AA:
		if c not in AA:
			AA[c] = 0
		AA[c] += AA[b]
		t += (c - b) * AA[b]
		ans += [t]
		del AA[b]
	else:
		ans += [t]
[print(a) for a in ans]
input1 = input().split(' ')
input2 = input().split(' ')
n = int(input1[0])
k = int(input1[1])
h = input2

for _ in range(k):
  if len(h) == 0:
    break
  h.pop(h.index(max(h)))

h = list(map(int, input2))
print(sum(h))

### FIXED CODE ###

input = input().split(' ')
h = int(input[0])
a = int(input[1])

if h % a == 0:
  print(int(h/a))
else:
  print(h//a + 1)
counter={}
ans=0
for i in range(n):
	ss = sorted(s[i])
	ss=("").join(ss)
	if ss not in counter:
		counter[ss]=0
	else:
		counter[ss]+=1
		ans+=counter[ss]

print(ans)

### FIXED CODE ###

from math import factorial as fact
import math
import sys
import itertools
import numpy as np
from collections import Counter
import datetime
from collections import deque

#入力:N(int:整数)
def input1():
	return int(input())

#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))

def keta(N):
	return len(str(N))


def input_daytime(input_time):
	time,distance=input_time.split()
	t=time.split(":")
	se=str(t[-1]).split(".")
	dt1 = datetime.timedelta(hours=int(t[0]),minutes=int(t[1]),seconds=int(se[0]),milliseconds=int(se[1]))
	return dt1

def combinations(n,r):
	return list(itertools.combinations(range(n),r))



def all_sets(num_list):
	subsets=[]
	for i in range(2,len(num_list) + 1):
		for c in combinations(num_list, i):
			subsets.append(c) 
	return subsets

#公約数の列挙
def ch(x1):
	cf=[]
	for i in range(2,math.sqrt(x1)+1):
		if x1 % i==0:
			cf.append(i)
	return cf

def CountOneRoots(x,y):
	#x:縦，y:横
	return fact(x+y)/fact(x)/fact(y)

# 素因数分解
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
	
def count_str(m):
	tmp={}
	for i in range(10):
		if i in tmp:
			tmp[i]=1
		else:
			tmp[i]+=1
	return tmp
		


n=input1()
s=[]
for i in range(n):
	s.append(str(input()))
str_dict={"".join(sorted(s[0])):0}
count=0
for i in range(1,n):
	now_d="".join(sorted(s[i]))
	if now_d in str_dict:
		str_dict[now_d]+=1
		count+=str_dict[now_d]
	else:
		str_dict[now_d]=0
print(count)
cell_num = int(input())
height = list(map(int, input().split()))
flag = True

for i in range(cell_num):
    if height[i+1] - height[i] == 1: height[i+1] -= 1
    elif height[i+1] - height[i] > 1:
        flag = False
        break

if flag: print("Yes")
else: print("No")

### FIXED CODE ###

cell_num = int(input())
height = list(map(int, input().split()))
flag = True

if cell_num != 1:
    if height[0] - height[1] <= 1:
        height[0] -= 1
    elif height[0] - height[1] > 1:
        flag = False
    
    for i in range(1,cell_num-1):
        if height[i] - height[i+1] > 1:
            flag = False
            break
        elif height[i] -  height[i+1] <= 1 and height[i-1] < height[i]:
            height[i] -= 1
        elif height[i] -  height[i+1] == 1 and height[i-1] == height[i]:
            flag = False
            break
            
if flag: print("Yes")
else: print("No")
w, h, x, y, r=map(int,input().split())
if x-r=>0 and r+x=<w and y-r>0 and r+y<h:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

w, h, x, y, r=map(int,input().split())
if x-r>=0 and r+x<=w and y-r>=0 and r+y<=h:
    print("Yes")
else:
    print("No")
c = input().split()
b = input().split()
ans = 0
for n in range(c[0]):
	a[n] = input().split()
	tmp = 0
	for m in range(c[1]):
		tmp += b[m] * a[n][m]
	if tmp > -c[2]:
		ans += 1
print(ans)

### FIXED CODE ###

c = input().split()
c = list(map(int, c))
b = input().split()
b = list(map(int, b))
ans = 0
a = [0] * (c[0])
for n in range(c[0]):
	a[n] = input().split()
	a[n] = list(map(int, a[n]))
	tmp = 0
	for m in range(c[1]):
		tmp += b[m] * a[n][m]
	if tmp > -c[2]:
		ans += 1
print(ans)
n = int(input())

used = []
ans = "Yes"

for i in range(n):
    if i == 0:
        t = str(input())
    else:
        t = str(input())
        print(t + "!")
        for j in used:
            if t == j:
                ans = "No"

        if len(t) == 1:
            if past[]
            
        else:
            if past[-1] != t[0]:
               ans == "No"
    used.append(t)
    past = t

print(ans)

### FIXED CODE ###


s = int(input())
last = str(input())
wordlist = [last]
ans = "Yes"

for i in range(s-1):
    word = str(input())

    if last[-1] != word[0]:
        ans = "No"
        break
    
    elif word in wordlist:
        ans = "No"
        break

    last = word
    wordlist.append(word)

print(ans)
N=int(input())
F=[list(map(int,input().split())) for _ in range(N)] #0-9
P=[list(map(int,input().split())) for _ in range(N)] #0-10

INF=10**9
ans=-INF

for i in range(1,2**10):
    tmp=[0]*10
    tmpans=0
    for j in range(0,10):
        bit=i>>j&1
        for n in range(N):
            tmp[n]+=F[n][j]*bit
    for n in range(N):
        tmpans+=P[n][tmp[n]]

    ans=max(ans,tmpans)

print(ans)

### FIXED CODE ###

N=int(input())
F=[list(map(int,input().split())) for _ in range(N)] #0-9
P=[list(map(int,input().split())) for _ in range(N)] #0-10

INF=10**9
ans=-INF

for i in range(1,2**10):
    tmpans=0
    for n in range(N):
        c=0
        for j in range(10):
            if (i>>j&1)&F[n][j]:
                c+=1
        tmpans+=P[n][c]

    ans=max(ans,tmpans)

print(ans)
n, m = map(int,input().split())
p = [[] for x in range(n)]
r = [-2] + [-1] * (n - 1)
for _ in range(m):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    p[a].append(b)
    p[b].append(a)
def bfs(room):
    global r
    l = []
    for iroom in p[room]:
        if r[iroom] == -1:
            r[iroom] = room
            l.append(iroom)
    for iroom in l:
        bfs(iroom)
bfs(0)

if -1 in r:
    print('No')
else:
    print('Yes')
    for i in r[1:]:
        print(i+1)

### FIXED CODE ###

n, m = map(int,input().split())
p = [[] for x in range(n)]
r = [-2] + [-1] * (n - 1)
for _ in range(m):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    p[a].append(b)
    p[b].append(a)

from collections import deque
dq = deque()
dq.append(0)

def bfs(room):
    l = []
    global r
    for iroom in p[room]:
        if r[iroom] == -1:
            r[iroom] = room
            l.append(iroom)
    return l

while len(dq) > 0:
    c = dq.popleft()
    ll = bfs(c)
    dq.extend(ll)

if -1 in r:
    print('No')
else:
    print('Yes')
    for i in r[1:]:
        print(i+1)
n=int(input())
arr=list(map(int,input().split()))
arr.sort()
d={}
ans=0
s1=0
d={i:0 for i in range(1,10**6)}
for i in arr:
    if i==1:
        s1+=1
        d[i]+=1
if s1!=0:
    if s1>1:
        print(0)
        quit()
    else:
        print(1)
        quit()
for i in range(n):
    x=arr[i]
    if d[x]==1:
        f=1
        for j in range(2,int(x**0.5)+1):
            y=x//j
            if (d[j]>=1 and x%j==0) or ( d[y]>=1 and x%(y)==0):
                f=0
                break
        if f==1:
             ans+=1
print(ans)

### FIXED CODE ###


import os
import sys
from io import BytesIO, IOBase


def main():
    n = int(input())
    arr = list(map(int, input().split()))
    arr.sort()
    ans = 0
    k=max(arr)
    d = [0]*(k+1)
    if arr[0] == 1:
        if n>1 and arr[1]==1:
            print(0)
            quit()
        else:
            print(1)
            quit()
    for i in range(n):
        d[arr[i]]+=1
    for i in range(n):
        x=arr[i]
        if d[x]==1:
            ans+=1
        for j in range(x,k+1,x):
            d[j]+=1
    print(ans)


# fast-io region

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)


def input():
    return sys.stdin.readline().rstrip("\r\n")


def write(*args, end="\n"):
    for x in args[:-1]:
        sys.stdout.write(str(x) + " ")
    sys.stdout.write(str(args[-1]))
    sys.stdout.write(end)


def r_array():
    return [int(x) for x in input().split()]


def r_int():
    return int(input())


if __name__ == "__main__":
    main()
n,k = map(int,input().split())
h = list(map(int, input().split()))

dp = [0]*n
dp[0] = 0
dp[1] = np.abs(h[0]-h[1])

for i in range(2,n):
     j = max(0,i-k)
     dp[i] = min([dp[l]+abs(h[i]-h[l]) for l in range(j,i)])

print(int(dp[n-1]))


### FIXED CODE ###

import numpy as np
N, K = (int(i) for i in input().split())  
h = np.array([int(i) for i in input().split()])
 
dp = np.empty(N, dtype='int')
 
for i in range(N):
  if i == 0:
    dp[i] = 0
  elif i - K < 0:
    dp[i] = np.min(np.abs(h[i] - h[:i]) + dp[:i])
  else:
    dp[i] = np.min(np.abs(h[i] - h[i-K:i]) + dp[i-K:i])
 
print(dp[N-1])
import sys
N = int(input())
A = list(map(int, input().split()))

money = 1000
urine = 0
kabu = 0 
n = 0
mode = ""

if N == 2 and A[0] == A[1] :
  print("1000")
  sys.exit()

if A[0] < A[1] :
  mode = "up"
  urine = A[0]
  kabu = money // urine
  money = money - kabu*urine
elif A[0] > A[1] :
  mode = "down"
else :
  while A[n] == A[n + 1]:
    if n + 2 > N :
      print("1000")
      sys.exit()
      
    if A[n + 1] < A[n + 2]:
      mode = "up"
      urine = A[n + 1]
      kabu = money // urine
      money = money - kabu*urine
      break
    elif A[n + 1] > A[n + 2]:
      mode ="down"
      break
    
    n += 1  

for i in range(N-1):
  if mode == "up" :
    if A[i] <= A[i + 1] :
      next
    elif A[i] > A[i +1] :
      mode = "down"
      money = money + kabu*A[i]

  elif mode == "down":
    if A[i] >= A[i + 1] :
      next
    elif A[i] < A[i +1] :
      mode = "up"
      urine = A[i]
      kabu = money // urine
      money = money - kabu * urine
      
if mode == "up" :
  print(money + A[N-1]*kabu)
else :
  print(money)


### FIXED CODE ###

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

money = 1000
kabu = 0 

for i in range(N-1):
  if A [i] < A[i + 1] and kabu == 0 :
    kabu = money // A[i]
    money = money - kabu*A[i]
  elif A[i] > A[i + 1] and kabu > 0:
    money = money + kabu*A[i]
    kabu = 0
    
if kabu > 0 :
  print(money + kabu*A[N-1])
else :
  print(money)
from goto import goto, label

S = input()

S = S.split()

L = int(S[0])
R = int(S[1])
min = 2 * (10**10)

flg = 0

for i in range(L, R, 1):
    if flg == 0:
        for j in range(i+1, R+1, 1):
            mod = (i*j) % 2019
            if mod < min:
                min = mod
                if min == 0:
                    flg = 1
                    break
    elif:
        break
print(min)


### FIXED CODE ###


S = input()

S = S.split()

L = int(S[0])
R = int(S[1])
min = 2 * (10**10)

flg = 0

for i in range(L, R, 1):
    if flg ==0:
        for j in range(i+1, R+1, 1):
            mod = (i*j) % 2019
            if mod < min:
                min = mod
                if min == 0:
                    flg = 1
                    break
    else:
        break

print(min)
A,B = map(int, input().split())
if A < = 8 and B <= 8:
    print("Yay!")
else:
    print(":(")

### FIXED CODE ###

A,B = map(int, input().split())
if A <= 8 and B <= 8:
    print("Yay!")
else:
    print(":(")
def main():
    x, a = map(int, input().split())
    if x < 0:
        print(0)
    elif x >= a:
        print(10i)
    

if __name__ == "__main__":
    main()


### FIXED CODE ###


def main():
    x, a = map(int, input().split())
    if x < a:
        print(0)
    else:
        print(10)
   

if __name__ == "__main__":
    main()
# coding: utf-8
N = int(input())
D = list(map(int, input().split()))
l = [0] * N
top = max(D)
mod = 998244353

for i in range(N):
    l[D[i]] += 1
# print(*l)
ans = 1
for i in range(1, top+1):
    if l[i] != 0:
        ans *= l[i-1] ** l[i]
    if l[i] == 0:
        print(0)
        exit()
    ans = ans % mod
if D[0] != 0:
    ans = 0
if l[0] != 1:
    ans = 0
    

print(ans)

### FIXED CODE ###

# coding: utf-8
N = int(input())
if N % 2 == 0:
    print(N // 2 - 1)
else:
    print(N // 2)