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.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeSet;
 

public class main {
    
    public static void main(String[] args) {        
        
        InputReader in = new InputReader(System.in);
        Scanner sc = new Scanner(System.in);
        PrintWriter p = new PrintWriter(System.out);
        int n;
        n=in.nextInt();
        int cost=(n-1)/2;
            System.out.println(cost);
        
        
        p.close();
    }
    
    public static long fib(long n){
        long F[][] = new long[][]{{1,1},{1,0}};
        if (n == 0)
            return 0;
        power(F, n-1);
      
        return F[0][0];
    }
    
    static void multiply(long F[][], long M[][]){
        long x =  (F[0][0]*M[0][0] + F[0][1]*M[1][0])%1000000007;
        long y =  (F[0][0]*M[0][1] + F[0][1]*M[1][1])%1000000007;
        long z =  (F[1][0]*M[0][0] + F[1][1]*M[1][0])%1000000007;
        long w =  (F[1][0]*M[0][1] + F[1][1]*M[1][1])%1000000007;
     
        F[0][0] = x;
        F[0][1] = y;
        F[1][0] = z;
        F[1][1] = w;
    }
      
    static void power(long F[][], long n){
        if( n == 0 || n == 1) 
            return;
        long M[][] = new long[][]{{1,1},{1,0}};
      
        power(F, n/2);
        multiply(F, F);
      
        if (n%2 != 0)
            multiply(F, M);
    }
    
   int sieveOfEratosthenes(int n){
        // Create a boolean array "prime[0..n]" and initialize
        // all entries it as true. A value in prime[i] will
        // finally be false if i is Not a prime, else true.
        boolean prime[] = new boolean[n+1];
        for(int i=0;i<n;i++)
            prime[i] = true;
         
        for(int p = 2; p*p <=n; p++)
        {
            // If prime[p] is not changed, then it is a prime
            if(prime[p] == true)
            {
                // Update all multiples of p
                for(int i = p*2; i <= n; i += p)
                    prime[i] = false;
            }
        }
        int c=0;
        for(int i = 2; i <= n; i++)
        {
            if(prime[i] == true)
                c++;
        }
        return c; 
        // Print all prime numbers
       /* for(int i = 2; i <= n; i++)
        {
            if(prime[i] == true)
                System.out.print(i + " ");
        }*/
    }
   static boolean isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;
 
    // This is checked so that we can skip 
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;
 
    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;
 
    return true;
}
    
 
    static class Pair implements Comparable<Pair> {
	int u;
	int v;
	BigInteger bi;
	public Pair(int u, int v) {
		this.u = u;
		this.v = v;
	}
 
	public int hashCode() {
		int hu = (int) (u ^ (u >>> 32));
		int hv = (int) (v ^ (v >>> 32));
		return 31 * hu + hv;
	}
 
	public boolean equals(Object o) {
		Pair other = (Pair) o;
		return u == other.u && v == other.v;
	}
 
	public int compareTo(Pair other) {
		return Long.compare(u, other.u) != 0 ? Long.compare(u, other.u) : Long.compare(v, other.v);
	}
 
	public String toString() {
		return "[u=" + u + ", v=" + v + "]";
	}
    }
 
    public static void debug(Object... o) {
            System.out.println(Arrays.deepToString(o));
    }
 
    static long modulo(long a,long b,long c) {
        long x=1;
        long y=a;
        while(b > 0){
                if(b%2 == 1){
                        x=(x*y)%c;
                }
                y = (y*y)%c; // squaring the base
                b /= 2;
        }
        return  x%c;
    }
    
    public static long getClosestK(long[] a, long x) {
 
        int low = 0;
        int high = a.length - 1;
 
        while (low <= high) {
            int mid = (low + high) / 2;
 
            // test lower case
            if (mid == 0) {
                if (a.length == 1) {
                    return a[0];
                }
 
                return Math.min(Math.abs(a[0] - x), Math.abs(a[1] - x)) + x;
            }
 
 
            // test upper case
            if (mid == a.length - 1) {
                return a[a.length - 1];
            }
 
            // test equality
            if (a[mid] == x || a[mid + 1] == x) {
                return x;
            }
 
 
            // test perfect range.
            if (a[mid] < x  && a[mid + 1] > x) {
                return Math.min(Math.abs(a[mid] - x), Math.abs(a[mid + 1] - x)) + x;
            }
 
            // keep searching.
            if (a[mid] < x) {
                low = mid + 1;
            } else { 
                high = mid;
            }
        }
        throw new IllegalArgumentException("The array cannot be empty");
    }
 
    long factorial(long n,long M) {
        long ans=1;
        while(n>=1)
        {
            ans=(ans*n)%M;
            n--;
        }
        return ans;
    }
 
    static long gcd(long x, long y){
	if(x==0)
		return y;
	if(y==0)
		return x;
	long r=0, a, b;
	a = (x > y) ? x : y; // a is greater number
	b = (x < y) ? x : y; // b is smaller number
	r = b;
	while(a % b != 0)
	{
		r = a % b;
		a = b;
		b = r;
	}
	return r;
    }
 
    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());
	}
    }
}
