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.io.*;
import java.lang.*;
import java.util.*;
 // number of prime numbers less then or equal to x are  -->  x/ln(x)
 public class d {
static class FastScanner {
InputStreamReader is;
BufferedReader br;
StringTokenizer st;
public FastScanner() {
is = new InputStreamReader(System.in);
br = new BufferedReader(is);
}
String next() throws Exception {
while (st == null || !st.hasMoreElements())
st = new StringTokenizer(br.readLine());
return st.nextToken();
}
int nextInt() throws Exception {
return Integer.parseInt(next());
}
long nextLong() throws Exception {
return Long.parseLong(next());
}
int[] readArray(int num) throws Exception {
int arr[]=new int[num];
for(int i=0;i<num;i++)
arr[i]=nextInt();
return arr;
}
String nextLine() throws Exception {
return br.readLine();
}
}
 public static boolean power_of_two(int a)
{
  if((a&(a-1))==0)
{
 return true;
}
return false;
}
static boolean PS(double x)
{
if (x >= 0) {
double i= Math.sqrt(x);
if(i%1!=0)
{
return false;
}
return ((i * i) == x);
}
return false;
}
public static int[] ia(int n)
{
    int ar[]=new int[n];
    return ar;
}
public static long[] la(int n)
{
    long ar[]=new long[n];
    return ar;
}
public static void print(int ans,int t)
{
    System.out.println("Case"+" "+"#"+t+":"+" "+ans);
}
static long mod=1000000007;
static int max=Integer.MIN_VALUE;
static int min=Integer.MAX_VALUE;
//****   M A I N      C O D E     ****
 
public static void main(String args[]) throws java.lang.Exception
{
FastScanner sc=new FastScanner();
int n=sc.nextInt();
int ans=(n)/2;
if(n%2==0)
{
ans-=1;
}                   
System.out.println(ans);
}
 }