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.*;
import java.io.*;
import java.math.*;
import java.math.BigInteger;
import java.text.DecimalFormat;

public class Lib {
	public static long maxLong = Long.MAX_VALUE;
	public static int maxInt = Integer.MAX_VALUE;
	public static long minLong = Long.MIN_VALUE;
	public static int minInt = Integer.MIN_VALUE;
	public static DecimalFormat df = new DecimalFormat("#.#####");
	public static final long MOD = (long) (1e9 + 7);
	
	
	public static void main(String args[])
	{
		InputReader in = new InputReader(System.in);
		OutputStream outputStream = System.out;
		PrintWriter out = new PrintWriter(outputStream);
		int n=in.nextInt();
		
		out.println((n-1)/2);
		
		
		out.close();
	}

	
	static int binarySearch(int arr[], int x, int l, int r)
    {
        while (l <= r)
        {
            int m = l + (r-l)/2;
 
            if (arr[m] == x)
                return m;
 
            if (arr[m] < x)
			{
				l = m + 1; 
			} 
            else
			{
				r = m - 1;
			}
        }
        return -1;
    }
	
	static int floorSearch(int arr[], int low, int high, int x)
	{
		int ans=-1;
		while(low<=high)
		{
			int mid=(low)+(high-low)/2;
			
			if (arr[mid] == x)
				return mid;
			else if(arr[mid]>x)
			{
				high=mid-1;
			}
			else
			{
				ans=mid;
				low=mid+1;				
			}
		}
		return ans;
	}


	static int ceilSearch(int arr[], int low, int high, int x)
    {
    	int ans=-1;
		while(low<=high)
		{
			int mid=(low)+(high-low)/2;
			
			if(arr[mid] == x)
				return mid;
			else if(arr[mid]>x)
			{
				ans=mid;
				high=mid-1;
			}
			else
			{
				low=mid+1;
			}
		}
		return ans;
    }
	
	static int gcd(int a, int b)
    {
        if (a == 0)
            return b;
        return gcd(b % a, a);
    }
	
    static int gcdArray(int arr[], int n)
    {
        int result = arr[0];
        for (int i = 1; i < n; i++)
            result = gcd(arr[i], result);
 
        return result;
    }
	
	static int lcm(int a, int b)
    {
        return (a*b)/gcd(a, b);
    }
	
	public static long ncr(long n, long r) 
	{
		long result=1;
		result = factorial(n)/(factorial(r)*factorial(n-r));
		return result;
	}
	
	public static long factorial(long n) 
	{
	   long c;
	   long result = 1;
	 
	   for (c = 1; c <= n; c++)
		  result = result*c;
	 
	   return result;
	}
	 static long modFactorial(long x)
	 {
		long i=x,mul=1;
		while(i>0)
		{
			mul=(mul%MOD)*(i%MOD)%MOD;
			i--;
		}
		return mul;
	 }
	
	public static long modPower(long base, long exp) 
	{
		long res=1;
		while(exp>0) {
		   if(exp%2==1) 
			   res=(res*base)%MOD;
		   base=(base*base)%MOD;
		   exp/=2;
		}
		return res%MOD;
	}
	
	
	static void printArray(int [] arr)
	{
		System.out.println(Arrays.toString(arr));
	}
	static void printArray(float [] arr)
	{
		System.out.println(Arrays.toString(arr));
	}
	static void printArray(double [] arr)
	{
		System.out.println(Arrays.toString(arr));
	}
	static void printArray(long [] arr)
	{
		System.out.println(Arrays.toString(arr));
	}
	static void printArray(char [] arr)
	{
		System.out.println(Arrays.toString(arr));
	}
	
	
	static void print2DArray(int [][] arr)
	{
		for(int [] a : arr)
		{
			System.out.println(Arrays.toString(a));
		}
	}
	static void print2DArray(float [][] arr)
	{
		for(float [] a : arr)
		{
			System.out.println(Arrays.toString(a));
		}
	}
	static void print2DArray(double [][] arr)
	{
		for(double [] a : arr)
		{
			System.out.println(Arrays.toString(a));
		}
	}
	static void print2DArray(long [][] arr)
	{
		for(long [] a : arr)
		{
			System.out.println(Arrays.toString(a));
		}
	}
	static void print2DArray(char [][] arr)
	{
		for(char [] a : arr)
		{
			System.out.println(Arrays.toString(a));
		}
	}
	
	static void printArrayObject(Object [] arr)
	{
		System.out.println(Arrays.toString(arr));
	}
	
	static void print2DArrayObject(Object [][] arr)
	{
		for(Object [] a : arr)
		{
			System.out.println(Arrays.toString(a));
		}
	}
	
	
	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream inputstream) {
			reader = new BufferedReader(new InputStreamReader(inputstream));
			tokenizer = null;
		}

		public String nextLine(){
			String fullLine=null;
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					fullLine=reader.readLine();
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				return fullLine;
			}
			return fullLine;
		}
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		
		public int[] nextIntArray(int n)	
		{
			int[] a=new int[n];
			for(int i=0;i<n;i++)
				a[i]=nextInt();
			return a;
		}
		public long[] nextLongArray(int n)	
		{
			long[] a=new long[n];
			for(int i=0;i<n;i++)
				a[i]=nextLong();
			return a;
		}
		public double[] nextDoubleArray(int n)	
		{
			double[] a=new double[n];
			for(int i=0;i<n;i++)
				a[i]=nextDouble();
			return a;
		}
		public String[] nextStringArray(int n)	
		{
			String[] a=new String[n];
			for(int i=0;i<n;i++)
				a[i]=next();
			return a;
		}
		
	}
	
	static class Pair implements Comparable<Pair>
	{
		private long first;
		private long second;
		//private long second;;

		public Pair(long i, long j) 
		{ 
			this.first = i;
			this.second = j;
		}
		public Pair() {
			// TODO Auto-generated constructor stub
		}
		public long getFirst() { return first; }
		//public long getSecond() { return second; }
		public long getSecond() { return second ;}
		public void setFirst(long k) { this.first=k ; }
		public void setSecond(long k) { this.second=k ;}
		//public void setSecond(long k) { this.second=k ;}
		@Override
		public int compareTo(Pair o) 
		{
			return Long.compare(this.first, o.first);
		}
	}
	
	
	static class LengthComparator implements Comparator<String> {
	    public int compare(String arg0, String arg1) {
			return (arg0+arg1).compareTo(arg1+arg0);
	    }
	}
}





class Graph
{
    private int V;   
    private LinkedList<Integer> adj[];
 
    Graph(int v)
    {
        V = v;
        adj = new LinkedList[v];
        for (int i=0; i<v; ++i)
            adj[i] = new LinkedList();
    }
 
    void addEdge(int v,int w)
    {
        adj[v].add(w);
    }
	
	void addEdgeUndirected(int v, int w)
    {
        adj[v].add(w);  // Add w to v's list.
        adj[w].add(v);    //Add v to w's list
    }
 
 
    void BFS(int s)
    {
        boolean visited[] = new boolean[V];
 
        LinkedList<Integer> queue = new LinkedList<Integer>();
 
        visited[s]=true;
        queue.add(s);
 
        while (queue.size() != 0)
        {
            s = queue.poll();
            System.out.print(s+" ");

            Iterator<Integer> i = adj[s].listIterator();
            while (i.hasNext())
            {
                int n = i.next();
                if (!visited[n])
                {
                    visited[n] = true;
                    queue.add(n);
                }
            }
        }
    }
	
	
	void DFS(int s)
    {
        boolean visited[] = new boolean[V];
 
        Stack<Integer> stack = new Stack<Integer>();
 
        visited[s]=true;
        stack.push(s);
 
        while (stack.size() != 0)
        {
            s = stack.pop();
            System.out.print(s+" ");

            Iterator<Integer> i = adj[s].listIterator();
            while (i.hasNext())
            {
                int n = i.next();
                if (!visited[n])
                {
                    visited[n] = true;
                    stack.push(n);
                }
            }
        }
    }
	
	void topologicalSortUtil(int v, boolean visited[], Stack stack)
    {
        visited[v] = true;
        Integer i;
 
        Iterator<Integer> it = adj[v].iterator();
        while (it.hasNext())
        {
            i = it.next();
            if (!visited[i])
                topologicalSortUtil(i, visited, stack);
        }
        stack.push(new Integer(v));
    }
 
    void topologicalSort()
    {
        Stack stack = new Stack();
 
        boolean visited[] = new boolean[V];
        for (int i = 0; i < V; i++)
            visited[i] = false;
 
        for (int i = 0; i < V; i++)
            if (visited[i] == false)
                topologicalSortUtil(i, visited, stack);
 
        while (stack.empty()==false)
            System.out.print(stack.pop() + " ");
    }
	
	
	void bridgeUtil(int u, boolean visited[], int disc[], int low[], int parent[])
    {
 
        int children = 0;
 
        visited[u] = true;
 
        disc[u] = low[u] = ++time;
 
        Iterator<Integer> i = adj[u].iterator();
        while (i.hasNext())
        {
            int v = i.next(); 
 
            if (!visited[v])
            {
                parent[v] = u;
                bridgeUtil(v, visited, disc, low, parent);
 
                low[u]  = Math.min(low[u], low[v]);
 
                if (low[v] > disc[u])
                    System.out.println(u+" "+v);
            }
            else if (v != parent[u])
                low[u]  = Math.min(low[u], disc[v]);
        }
    }
 
    void bridge()
    {
        boolean visited[] = new boolean[V];
        int disc[] = new int[V];
        int low[] = new int[V];
        int parent[] = new int[V];
 
 
        for (int i = 0; i < V; i++)
        {
            parent[i] = NIL;
            visited[i] = false;
        }
 
        for (int i = 0; i < V; i++)
            if (visited[i] == false)
                bridgeUtil(i, visited, disc, low, parent);
    }
	
	
	void DFSUtil(int v,boolean visited[])
    {
        visited[v] = true;

        Iterator<Integer> i = adj[v].listIterator();
        while (i.hasNext())
        {
            int n = i.next();
            if (!visited[n])
                DFSUtil(n, visited);
        }
    }

    void motherVertex()
    {
        boolean visited[] = new boolean[V];
        for (int i = 0; i < V; i++)
        {
            visited[i] = false;
        }    
        
        // The vertex that finishes last should be the mother node
        int v = -1;
        for (int i = 0; i < V; i++)
        {
            if (visited[i] == false)
            {
                DFSUtil(i, visited);
                v = i;
            }
        }
        
        for (int i = 0; i < V; i++)
        {
            visited[i] = false;
        }
        
        System.out.println(" Mother Vertex Detected At:"  + v);
        
        DFSUtil(v, visited);
        for(int i = 0; i < V; i++)
        {
            if(visited[i] == false)
            {
                System.out.println("Not a mother vertex.Node that wasn't connected :" + i);        
                return;
            }
        }
        System.out.println(" Mother Vertex: "  + v);
    }
	
}