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.util.*;
public final class code
// class code
// public class Solution
{
static void solve()throws IOException
{
    int n=nextInt();
    if(n%2==0)
        out.println(n/2-1);
    else
        out.println(n/2);
}
///////////////////////////////////////////////////////////
public static void main(String args[])throws IOException
{
br=new BufferedReader(new InputStreamReader(System.in));
out=new PrintWriter(new BufferedOutputStream(System.out));
random=new Random();

solve();

// int t=nextInt();
// for(int i=1;i<=t;i++)
// {
// // out.print("Case #"+i+": ");
// solve();
// }

out.close();
}

static final long mod=(long)(1e9+7);
static final int inf=(int)(1e9+1);
// static final long inf=(long)(1e18);

static class Pair implements Comparable<Pair>
{
    int first,second;
    Pair(int a,int b)
    {
        first=a;
        second=b;
    }
    public int compareTo(Pair p)
    {
        return first-p.first;
    }
}

static int max(int ... a)
{
int ret=a[0];
for(int i=1;i<a.length;i++)
ret=Math.max(ret,a[i]);
return ret;
}
static int min(int ... a)
{
int ret=a[0];
for(int i=1;i<a.length;i++)
ret=Math.min(ret,a[i]);
return ret;
}
static void debug(Object ... a)
{
System.out.print("> ");
for(int i=0;i<a.length;i++)
System.out.print(a[i]+" ");
System.out.println();
}
static void debug(int a[]){debuga(Arrays.stream(a).boxed().toArray());}
static void debug(long a[]){debuga(Arrays.stream(a).boxed().toArray());}
static void debuga(Object a[])
{
System.out.print("> ");
for(int i=0;i<a.length;i++)
System.out.print(a[i]+" ");
System.out.println();
}
static Random random;
static BufferedReader br;
static StringTokenizer st;
static PrintWriter out;
static String nextToken()throws IOException
{
while(st==null || !st.hasMoreTokens())
st=new StringTokenizer(br.readLine());
return st.nextToken();
}
static String nextLine()throws IOException
{
return br.readLine();
}
static int nextInt()throws IOException
{
return Integer.parseInt(nextToken());
}
static long nextLong()throws IOException
{
return Long.parseLong(nextToken());
}
static double nextDouble()throws IOException
{
return Double.parseDouble(nextToken());
}
}