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.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Comparator;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Map;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
 
 
public class Main{
	
	private static BufferedWriter bw;
	private static BufferedReader br;
	
	
	public static void main(String[] args) throws Exception{
		br=new BufferedReader(new InputStreamReader(System.in));
		//bw = new BufferedWriter(new OutputStreamWriter(System.out));
		Scan scan=new Scan();
		Print print=new Print();
		int n=scan.scanInt();
		if(n<=2)
			print.printLine("0");
		else
			print.printLine(Integer.toString(n/2-1*(1-n%2)));
	}
	
	
	private static class Scan
	{
		private byte[] buf=new byte[1024];
		private int index;
		private InputStream in;
		private int total;
		public Scan()
		{
			in=System.in;
		}
		public int scan()throws IOException
		{
			if(total<0)
			throw new InputMismatchException();
			if(index>=total)
			{
				index=0;
				total=in.read(buf);
				if(total<=0)
				return -1;
			}
			return buf[index++];
		}
		public int scanInt()throws IOException
		{
			int integer=0;
			int n=scan();
			while(isWhiteSpace(n))
			n=scan();
			int neg=1;
			if(n=='-')
			{
				neg=-1;
				n=scan();
			}
			while(!isWhiteSpace(n))
			{
				if(n>='0'&&n<='9')
				{
					integer*=10;
					integer+=n-'0';
					n=scan();
				}
				else throw new InputMismatchException();
			}
			return neg*integer;
		}
		public double scanDouble()throws IOException
		{
			double doub=0;
			int n=scan();
			while(isWhiteSpace(n))
			n=scan();
			int neg=1;
			if(n=='-')
			{
				neg=-1;
				n=scan();
			}
			while(!isWhiteSpace(n)&&n!='.')
			{
				if(n>='0'&&n<='9')
				{
					doub*=10;
					doub+=n-'0';
					n=scan();
				}
				else throw new InputMismatchException();
			}
			if(n=='.')
			{
				n=scan();
				double temp=1;
				while(!isWhiteSpace(n))
				{
					if(n>='0'&&n<='9')
					{
						temp/=10;
						doub+=(n-'0')*temp;
						n=scan();
					}
					else throw new InputMismatchException();
				}
			}
			return doub*neg;
		}
		public String scanString()throws IOException
		{
			StringBuilder sb=new StringBuilder();
			int n=scan();
			while(isWhiteSpace(n))
			n=scan();
			while(!isWhiteSpace(n))
			{
				sb.append((char)n);
				n=scan();
			}
			return sb.toString();
		}
		private boolean isWhiteSpace(int n)
		{
			if(n==' '||n=='\n'||n=='\r'||n=='\t'||n==-1)
			return true;
			return false;
		}
	}
	
	private static class Print
	{
		private final OutputStream out;
		/*public Print(OutputStream outputStream)
		{
			writer=new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}*/
		public Print()
		{
			this.out=System.out;
		}
		public void print(String str)throws IOException
		{
			//buf=str.getBytes();
			for (int i = 0; i < str.length(); i++)
			{
				/*if (i != 0)
				out.write(' ');*/
				out.write(str.charAt(i));
			}
		}
		public void printLine(String str)throws IOException
		{
			print(str);
			out.write('\n');
		}
		public void close()throws IOException
		{
			out.close();
		}
	}
}   