A few years ago Sajjad left his school and register to another one due to security reasons. Now he wishes to find Amir, one of his schoolmates and good friends.

There are n schools numerated from 1 to n. One can travel between each pair of them, to do so, he needs to buy a ticket. The ticker between schools i and j costs $(i + j) \operatorname{mod}(n + 1)$ and can be used multiple times. Help Sajjad to find the minimum cost he needs to pay for tickets to visit all schools. He can start and finish in any school.


-----Input-----

The first line contains a single integer n (1 ≤ n ≤ 10^5) — the number of schools.


-----Output-----

Print single integer: the minimum cost of tickets needed to visit all schools.


-----Examples-----
Input
2

Output
0

Input
10

Output
4



-----Note-----

In the first example we can buy a ticket between the schools that costs $(1 + 2) \operatorname{mod}(2 + 1) = 0$.

Difficulty: competition

Starter code:

Solutions:
n = int(input())
print((n-1) // 2)


import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline

n=int(input())

print((n-1)//2)

from sys import stdin, stdout


n = int(stdin.readline().rstrip())

if n%2:
    print((n-1)//2)
else:
    print(n//2 - 1)


n = int(input())
print ((n - 1) // 2)

import itertools

def solve(n):
    ans = (n + 1) // 2

    return ans - 1

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

main()


schools = int(input())

print((schools-1)//2)

n=int(input())
n+=1
print(int(n/2)-1)

def main():
    n = int(input())
    print((n-1) // 2)


def __starting_point():
    main()

__starting_point()

i=int(input())
if i%2:
  print((i-1)//2)
else:
  print(i//2-1)

n = int(input())
print((n - 1) // 2)

n = int(input())
print((n+1)//2 - 1)

n=int(input())
print(int((n+1)/2-1))



n = input()
n = int(n)
if (n % 2) != 0:
	print (n // 2)
else:
	print ((n // 2) -1)

a = int(input())
print(int((a-1)/2))

n=int(input())
print ((n-1)//2)

n=int(input())
print(n//2-1+n%2)


def boka():
    s = int(input())
    s -= 1
    s /= 2
    s = int(s)
    print(s)


boka()


print((int(input())-1) // 2)

x = int(input())
x = x-1
print(int(x/2))

a = int(input())
print((a - 1) // 2)


n=int(input())
q=2
r=n+2
if n%2==0:
   print((n//2)-1)
else:print(n//2)
   


n = int(input())
print((n+1)//2 -1)


n=int(input())
if n%2==0 :
    print((n//2)-1)
else :
    print(n//2)


import sys

n = int(sys.stdin.read())

print((n - 1) // 2)


a = int(input())

if a == 1:
    print("0")
else:
    s = 1
    t = a
    q = []
    if a % 2 == 0:
        while t > s:
            q += [s]
            q += [t]
            s += 1
            t -= 1
    else:
        while t != s:
            q += [s]
            q += [t]
            s += 1
            t -= 1
        q += [s]

    i = 0
    wyn = 0
    while i < len(q) - 1:
           wyn += (q[i] + q[i+1]) % (a + 1)
           i += 1
    print(wyn)