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 <image> 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 ≤ 105) — 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 <image>.
import java.util.Scanner;

//题意:给定n个学校，需要遍历所有学校,可从任意一点开始.
//i到j有(i+j) mod (n+1) 的花费，求最小花费。
//
//考虑贪心:先走和为n+1的两处，走完后最小只能再走到和为n+2的学校，再走到和为n+1的。。。。。。
//(1)例如: 1 2 3 4 5 6 7 8 9 10(n为偶数)
//先走1->10 花费为0 
//再走10->2 花费为1
//再走2->9 花费为0
//再走9->3 花费为1
//再走3->8 花费为0
//再走8->4 花费为1
//再走4->7 花费为0
//再走7->5 花费为1
//再走5->6 花费为0
//...
//(2)例如：1 2 3(n为奇数)
//先走1->3 花费为0
//先走3->2 花费为1
//最后答案，如果n是奇数，就是n/2 否则就是n/2-1.
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		if(n%2==0)
		{
			System.out.println(n/2-1);
		}
		else 
		{
			System.out.println(n/2);
		}
	}

}

   	 	 	  		  	 	      		 		 		