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  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.

The first line contains a single integer n (1 ≤ n ≤ 105) — the number of schools.

Print single integer: the minimum cost of tickets needed to visit all schools.

NoteIn the first example we can buy a ticket between the schools that costs .

using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
//using System.Linq;
using System.Text;

namespace ContestRuns
{
    using System.ComponentModel;
    using System.Linq;
    using System.ServiceProcess;

    class Program
    {
        class Edge
        {
            public int a, b, cap, flow;
        };

        private static int n, source, target;
        private static int[] d, ptr, q;
        private static List<Edge> e = new List<Edge>();
        private static List<List<int>> g;

        static void add_edge(int a, int b, int cap)
        {
            Edge e1 = new Edge {a = a, b = b, cap = cap, flow = 0};
            Edge e2 = new Edge {a = b, b = a, cap = 0, flow = 0};
            g[a].Add(e.Count);
            e.Add(e1);
            g[b].Add(e.Count);
            e.Add(e2);
        }

        static bool bfs()
        {
            int qh = 0, qt = 0;
            q[qt++] = source;

            d = Enumerable.Repeat(-1, n).ToArray();
            d[source] = 0;
            while (qh < qt && d[target] == -1)
            {
                int v = q[qh++];
                for (int i = 0; i < g[v].Count; ++i)
                {
                    int id = g[v][i],
                        to = e[id].b;
                    if (d[to] == -1 && e[id].flow < e[id].cap)
                    {
                        q[qt++] = to;
                        d[to] = d[v] + 1;
                    }
                }
            }
            return d[target] != -1;
        }

        static int dfs(int v, int flow)
        {
            if (flow <= 0) return 0;
            if (v == target) return flow;
            for (; ptr[v] < g[v].Count; ++ptr[v])
            {
                int id = g[v][ptr[v]],
                    to = e[id].b;
                if (d[to] != d[v] + 1) continue;
                int pushed = dfs(to, Math.Min(flow, e[id].cap - e[id].flow));
                if (pushed != 0)
                {
                    e[id].flow += pushed;
                    e[id ^ 1].flow -= pushed;
                    return pushed;
                }
            }
            return 0;
        }

        static int dinic()
        {
            int flow = 0;
            for (;;)
            {
                if (!bfs()) break;
                ptr = new int[n];
                for (;;)
                {
                    int pushed = dfs(source, int.MaxValue);
                    if (pushed == 0) break;
                    flow += pushed;
                }
            }
            return flow;
        }

#if DEBUG
        static readonly TextReader input = File.OpenText(@"../../A/A.in");
        static readonly TextWriter output = File.CreateText(@"../../A/A.out");
#else
        static readonly TextReader input = Console.In;
        static readonly TextWriter output = Console.Out;
#endif

        class Horse
        {
            public decimal distForHorse;
            public decimal timeAlready;
        };
        class Edge1
        {
            public int from, to;
            public decimal dist;
        };
        private static void SolveA()
        {
            int T = int.Parse(input.ReadLine());

            output.WriteLine((T/2 + T%2)-1);
            //int[] inp = input.ReadLine().Split(' ').Select(int.Parse).ToArray();
        }

        static void Main(string[] args)
        {
            SolveA();
            output.Flush();
        }
    }

}

using System;
class P {
    static void Main() {
        int n = int.Parse(Console.ReadLine());
        Console.WriteLine(n % 2 == 0 ? n / 2 - 1 : n / 2);
    }
}

using System;
using System.Diagnostics;
using System.IO;
using System.Linq;

namespace Codeforces
{
	internal class Template
	{
		private void Solve()
		{
			var n = cin.NextInt();
			var res = ((n + 1)/2) - 1;
			Console.WriteLine(res);
		}

		private static readonly Scanner cin = new Scanner();

		private static void Main()
		{
#if DEBUG
			var inputText = File.ReadAllText(@"..\..\input.txt");
			var testCases = inputText.Split(new[] { "input" }, StringSplitOptions.RemoveEmptyEntries);
			var consoleOut = Console.Out;
			for (var i = 0; i < testCases.Length; i++)
			{
				var parts = testCases[i].Split(new[] { "output" }, StringSplitOptions.RemoveEmptyEntries);
				Console.SetIn(new StringReader(parts[0].Trim()));
				var stringWriter = new StringWriter();
				Console.SetOut(stringWriter);
				var sw = Stopwatch.StartNew();
				new Template().Solve();
				sw.Stop();
				var output = stringWriter.ToString();

				Console.SetOut(consoleOut);
				var color = ConsoleColor.Green;
				var status = "Passed";
				if (parts[1].Trim() != output.Trim())
				{
					color = ConsoleColor.Red;
					status = "Failed";
				}
				Console.ForegroundColor = color;
				Console.WriteLine("Test {0} {1} in {2}ms", i + 1, status, sw.ElapsedMilliseconds);
			}
			Console.ReadLine();
			Console.ReadKey();
#else
			new Template().Solve();
			Console.ReadLine();
#endif
		}
	}

	internal class Scanner
	{
		private string[] s = new string[0];
		private int i;
		private readonly char[] cs = { ' ' };

		public string NextString()
		{
			if (i < s.Length) return s[i++];
			var line = Console.ReadLine() ?? string.Empty;
			s = line.Split(cs, StringSplitOptions.RemoveEmptyEntries);
			i = 1;
			return s.First();
		}

		public double NextDouble()
		{
			return double.Parse(NextString());
		}

		public int NextInt()
		{
			return int.Parse(NextString());
		}

		public long NextLong()
		{
			return long.Parse(NextString());
		}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dev2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Int32.Parse(Console.ReadLine());
            if (n < 2)
                Console.Write(0);
            else if (n %2!=0)
                Console.WriteLine(n/2);
            else
                Console.Write(n / 2 - 1);
        }
    }
}

using System;

namespace _805C
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Console.WriteLine((n - 1) / 2);
        }
    }
}

using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Globalization;

public class Solution
{
    public TextInput cin;
    public TextOutput cout;
    public TextOutput cerr;

    public virtual void Solve()
    {
        var n = cin.Read<int>();
        cout.WriteLine((n - 1) / 2);
    }
}

#region Core
static class MainClass
{
    // public static readonly TextInput cin = new TextInput("building.in");// new TextInput(Console.In);
    // public static readonly TextOutput cout = new TextOutput("building.out");//new TextOutput(Console.Out);
    public static readonly TextInput cin = new TextInput(Console.In);
    public static readonly TextOutput cout = new TextOutput(Console.Out);
    public static readonly TextOutput cerr = new TextOutput(Console.Error);
#if !DEBUG
    static void Main()
    {
        new Solution
        {
            cin = cin,
            cout = cout,
            cerr = cerr
        }.Solve();
    }
#endif
}
public class SDictionary<TKey, TValue> : Dictionary<TKey, TValue>
{
    public new TValue this[TKey key]
    {
        get
        {
            TValue res;
            base.TryGetValue(key, out res);
            return res;
        }
        set
        {
            base[key] = value;
        }
    }
}
public static class Ext
{
    public static string ToString(this decimal v, int precision)
    {
        return v.ToString("0." + new string('0', precision), CultureInfo.InvariantCulture);
    }
    public static string ToString(this double v, int precision)
    {
        return v.ToString("0." + new string('0', precision), CultureInfo.InvariantCulture);
    }
    public static string ToString(this float v, int precision)
    {
        return v.ToString("0." + new string('0', precision), CultureInfo.InvariantCulture);
    }
    #region Prewriten
    public static void Foreach<T>(this IEnumerable<T> elements, Action<T> action)
    {
        foreach (var element in elements)
        {
            action(element);
        }
    }
    public static void Foreach<T>(this IEnumerable<T> elements, Action<T, int> action)
    {
        var index = 0;
        foreach (var element in elements)
        {
            action(element, index++);
        }
    }
    public static void Do(int from, int n, Action<int> action)
    {
        for (var i = from; i < n; i++) action(i);
    }
    public static IEnumerable<T> Init<T>(int n) where T : new()
    {
        for (var i = 0; i < n; i++)
        {
            yield return new T();
        }
    }
    public static IEnumerable<T> Init<T>(int n, T defaultValue = default(T))
    {
        for (var i = 0; i < n; i++)
        {
            yield return defaultValue;
        }
    }
    public static IEnumerable<T> Init<T>(int n, Func<T> builder)
    {
        for (var i = 0; i < n; i++)
        {
            yield return builder();
        }
    }
    public static IEnumerable<T> Init<T>(int n, Func<int, T> builder)
    {
        for (var i = 0; i < n; i++)
        {
            yield return builder(i);
        }
    }
    public static bool IsEmpty(this string s)
    {
        return string.IsNullOrEmpty(s);
    }
    public static string Safe(this string s)
    {
        return s.IsEmpty() ? string.Empty : s;
    }
    public static void Swap<T>(ref T a, ref T b)
    {
        T c = a;
        a = b;
        b = c;
    }
    public static long Gcd(long a, long b)
    {
        while (a > 0)
        {
            b %= a;
            Swap(ref a, ref b);
        }
        return b;
    }
    public static int[] ZFunction(string s)
    {
        var z = new int[s.Length];
        for (int i = 1, l = 0, r = 0; i < s.Length; ++i)
        {
            if (i <= r)
            {
                z[i] = Math.Min(r - i + 1, z[i - l]);
            }
            while (i + z[i] < s.Length && s[z[i]] == s[i + z[i]])
            {
                z[i]++;
            }
            if (i + z[i] - 1 > r)
            {
                l = i;
                r = i + z[i] - 1;
            }
        }
        return z;
    }
    public static long Pow(long a, long p)
    {
        var b = 1L;
        while (p > 0)
        {
            if ((p & 1) == 0)
            {
                a *= a;
                p >>= 1;
            }
            else
            {
                b *= a;
                p--;
            }
        }
        return b;
    }
    #endregion
}

public delegate bool TryParseDelegate<T>(string s, NumberStyles style, IFormatProvider format, out T value);
public class TextInput
{
    private static Dictionary<Type, Delegate> primitiveParsers = new Dictionary<Type, Delegate>
        {
            { typeof(sbyte), new TryParseDelegate<sbyte>(sbyte.TryParse) },
            { typeof(short), new TryParseDelegate<short>(short.TryParse) },
            { typeof(int),  new TryParseDelegate<int>(int.TryParse) },
            { typeof(long), new TryParseDelegate<long>(long.TryParse) },

            { typeof(byte), new TryParseDelegate<byte>(byte.TryParse) },
            { typeof(ushort), new TryParseDelegate<ushort>(ushort.TryParse) },
            { typeof(uint), new TryParseDelegate<uint>(uint.TryParse) },
            { typeof(ulong), new TryParseDelegate<ulong>(ulong.TryParse) },

            { typeof(float), new TryParseDelegate<float>(float.TryParse) },
            { typeof(double), new TryParseDelegate<double>(double.TryParse) },
            { typeof(decimal), new TryParseDelegate<decimal>(decimal.TryParse) },

            { typeof(char), new TryParseDelegate<char>(CharParser) },
            { typeof(string), new TryParseDelegate<string>(StringParser) }
        };
    private static bool CharParser(string s, NumberStyles style, IFormatProvider format, out char res)
    {
        res = char.MinValue;
        if (string.IsNullOrEmpty(s))
        {
            return false;
        }
        else
        {
            res = s[0];
            return true;
        }
    }
    private static bool StringParser(string s, NumberStyles style, IFormatProvider format, out string res)
    {
        res = s == null ? string.Empty : s;
        return true;
    }

    private string line = null;
    private int pos = 0;

    public IFormatProvider FormatProvider { get; set; }
    public NumberStyles NumberStyle { get; set; }
    public TextReader TextReader { get; set; }

    public TextInput(string path) : this(path, NumberStyles.Any, CultureInfo.InvariantCulture)
    {
    }
    public TextInput(string path, NumberStyles numberStyle, IFormatProvider formatProvider) : this(new StreamReader(path), numberStyle, formatProvider)
    {

    }
    public TextInput(TextReader textReader) : this(textReader, NumberStyles.Any, CultureInfo.InvariantCulture)
    {

    }
    public TextInput(TextReader textReader, NumberStyles numberStyle, IFormatProvider formatProvider)
    {
        TextReader = textReader;
        NumberStyle = numberStyle;
        FormatProvider = formatProvider;
    }

    public bool IsEof
    {
        get
        {
            if ((line == null || pos >= line.Length) && TextReader.Peek() == -1)
            {
                Next();
                return line == null;
            }
            return false;
        }
    }
    public void SkipWhiteSpace()
    {
        while (!IsEof)
        {
            if (line != null && pos < line.Length && !char.IsWhiteSpace(line[pos]))
            {
                return;
            }
            if (line == null || pos >= line.Length)
            {
                Next();
                continue;
            }
            while (pos < line.Length && char.IsWhiteSpace(line[pos]))
            {
                pos++;
            }
        }
    }
    private void SkipWhiteSpace(bool force)
    {
        if (force)
        {
            SkipWhiteSpace();
        }
        else
        {
            SkipWhiteSpace();
        }
    }

    public T[] ReadArray<T>()
    {
        var length = Read<int>();
        return ReadArray<T>(length);
    }
    public T[] ReadArray<T>(int length)
    {
        var array = new T[length];

        var parser = GetParser<T>();
        var style = NumberStyle;
        var format = FormatProvider;

        for (var i = 0; i < length; i++)
        {
            array[i] = Read<T>(parser, style, format);
        }
        return array;
    }

    public bool TryReadArray<T>(out T[] array)
    {
        return TryReadArray<T>(GetParser<T>(), NumberStyle, FormatProvider, out array);
    }
    public bool TryReadArray<T>(out T[] array, int length)
    {
        return TryReadArray<T>(GetParser<T>(), NumberStyle, FormatProvider, out array, length);
    }
    public bool TryReadArray<T>(T[] array, int offset, int length)
    {
        return TryReadArray<T>(GetParser<T>(), NumberStyle, FormatProvider, array, offset, length);
    }
    public bool TryReadArray<T>(TryParseDelegate<T> parser, NumberStyles style, IFormatProvider format, out T[] array)
    {
        var length = 0;
        if (!TryRead<int>(out length))
        {
            array = null;
            return false;
        }
        array = new T[length];
        return TryReadArray<T>(parser, style, format, array, 0, length);
    }
    public bool TryReadArray<T>(TryParseDelegate<T> parser, NumberStyles style, IFormatProvider format, out T[] array, int length)
    {
        array = new T[length];
        return TryReadArray<T>(parser, style, format, array, 0, length);
    }
    public bool TryReadArray<T>(TryParseDelegate<T> parser, NumberStyles style, IFormatProvider format, T[] array, int offset, int length)
    {
        var result = true;
        for (var i = 0; i < length && result; i++)
        {
            result &= TryRead<T>(parser, style, format, out array[offset + i]);
        }
        return result;
    }

    private TryParseDelegate<T> GetParser<T>()
    {
        var type = typeof(T);
        return (TryParseDelegate<T>)primitiveParsers[type];
    }
    public T Read<T>()
    {
        return Read<T>(GetParser<T>());
    }
    public T Read<T>(NumberStyles style, IFormatProvider format)
    {
        return Read<T>(GetParser<T>(), style, format);
    }
    public T Read<T>(TryParseDelegate<T> parser)
    {
        return Read<T>(parser, NumberStyle, FormatProvider);
    }
    public T Read<T>(TryParseDelegate<T> parser, NumberStyles style, IFormatProvider format)
    {
        T result;
        if (!TryRead(parser, style, format, out result))
        {
            throw new FormatException();
        }
        return result;
    }
    public bool TryRead<T>(out T value)
    {
        return TryRead(GetParser<T>(), out value);
    }
    public bool TryRead<T>(NumberStyles style, IFormatProvider format, out T value)
    {
        return TryRead(GetParser<T>(), style, format, out value);
    }
    public bool TryRead<T>(TryParseDelegate<T> parser, out T value)
    {
        return parser(ReadToken(), NumberStyle, FormatProvider, out value);
    }
    public bool TryRead<T>(TryParseDelegate<T> parser, NumberStyles style, IFormatProvider format, out T value)
    {
        return parser(ReadToken(), style, format, out value);
    }
    public string ReadToken()
    {
        SkipWhiteSpace(false);
        if (IsEof)
        {
            throw new EndOfStreamException();
        }

        if (pos >= line.Length || char.IsWhiteSpace(line[pos])) return string.Empty;

        var start = pos;
        while (pos < line.Length && !char.IsWhiteSpace(line[pos]))
        {
            pos++;
        }
        return line.Substring(start, pos - start);
    }
    public string ReadLine()
    {
        if (IsEof)
        {
            throw new EndOfStreamException();
        }
        if (line == null || pos >= line.Length)
        {
            Next();
        }

        var ans = line.Substring(pos);
        pos = line.Length;
        return ans;
    }

    private void Next()
    {
        line = TextReader.ReadLine();
        pos = 0;
    }
}

public class TextOutput
{
    public IFormatProvider FormatProvider { get; set; }
    public TextWriter TextWriter { get; set; }

    public TextOutput(string path) : this(path, CultureInfo.InvariantCulture)
    {
    }
    public TextOutput(string path, IFormatProvider formatProvider) : this(new StreamWriter(path), formatProvider)
    {

    }
    public TextOutput(TextWriter textWriter) : this(textWriter, CultureInfo.InvariantCulture)
    {

    }
    public TextOutput(TextWriter textWriter, IFormatProvider formatProvider)
    {
        TextWriter = textWriter;
        FormatProvider = formatProvider;
    }

    public TextOutput WriteArray<T>(params T[] array)
    {
        return WriteArray(array, true);
    }
    public TextOutput WriteArray<T>(T[] array, bool appendLine)
    {
        return WriteArray(array, 0, array.Length, appendLine);
    }
    public TextOutput WriteArray<T>(T[] array, int offset, int length, bool appendLine = true)
    {
        var sb = new StringBuilder();
        for (var i = 0; i < length; i++)
        {
            sb.Append(Convert.ToString(array[offset + i], FormatProvider));
            if (i + 1 < length)
            {
                sb.Append(' ');
            }
        }
        return appendLine ? WriteLine(sb.ToString()) : Write(sb.ToString());
    }

    public TextOutput WriteLine(object obj)
    {
        return WriteLine(Convert.ToString(obj, FormatProvider));
    }
    public TextOutput WriteLine(string text, params object[] args)
    {
        return WriteLine(string.Format(FormatProvider, text, args));
    }
    public TextOutput WriteLine(string text)
    {
        TextWriter.WriteLine(text);
        return this;
    }
    public TextOutput WriteLine(char[] buffer)
    {
        TextWriter.WriteLine(buffer);
        return this;
    }
    public TextOutput WriteLine(char[] buffer, int offset, int length)
    {
        TextWriter.WriteLine(buffer, offset, length);
        return this;
    }
    public TextOutput WriteLine()
    {
        TextWriter.WriteLine();
        return this;
    }

    public TextOutput Write(object obj)
    {
        return Write(Convert.ToString(obj, FormatProvider));
    }
    public TextOutput Write(string text, params object[] args)
    {
        return Write(string.Format(FormatProvider, text, args));
    }
    public TextOutput Write(string text)
    {
        TextWriter.Write(text);
        return this;
    }
    public TextOutput Write(char[] buffer)
    {
        TextWriter.Write(buffer);
        return this;
    }
    public TextOutput Write(char[] buffer, int offset, int length)
    {
        TextWriter.Write(buffer, offset, length);
        return this;
    }
}
#endregion

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;

namespace CF317
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var sr = new InputReader(Console.In);
            //var sr = new InputReader(new StreamReader("input.txt"));
            var task = new Task();
            using (var sw = Console.Out)
            {
                //using (var sw = new StreamWriter("output.txt")) {
                task.Solve(sr, sw);
                //Console.ReadKey();
            }
        }
    }

    internal class Task
    {
        public void Solve(InputReader sr, TextWriter sw)
        {
            var n = sr.NextInt32();
            var mid = n / 2;
            if (n % 2 == 1) {
                mid++;
            }
            var count = 0;
            for (var i = 2; i <= mid; i++) {
                count++;
            }

            sw.WriteLine(count);
        }
    }
}

internal class InputReader : IDisposable
{
    private bool isDispose;
    private readonly TextReader sr;

    public InputReader(TextReader stream)
    {
        sr = stream;
    }

    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    public string NextString()
    {
        var result = sr.ReadLine();
        return result;
    }

    public int NextInt32()
    {
        return Int32.Parse(NextString());
    }

    public long NextInt64()
    {
        return Int64.Parse(NextString());
    }

    public string[] NextSplitStrings()
    {
        return NextString()
                        .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
    {
        return NextSplitStrings()
                        .Select(s => func(s, CultureInfo.InvariantCulture))
                        .ToArray();
    }

    public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
    {
        return
                        str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
                                        .Select(s => func(s, CultureInfo.InvariantCulture))
                                        .ToArray();
    }

    protected void Dispose(bool dispose)
    {
        if (!isDispose)
        {
            if (dispose)
                sr.Close();
            isDispose = true;
        }
    }

    ~InputReader()
    {
        Dispose(false);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine((n-1)/2);
        }
    }
}

using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            //StreamReader reader = new StreamReader("input.txt"); // убрать чтение из файла
            int n = Convert.ToInt32(Console.ReadLine()); // убрать чтение из файла
            //reader.Close(); // убрать чтение из файла

            int ans = (n - 1) / 2;
            if (n <= 2)
            {
                ans = 0;
            }

            Console.WriteLine(ans);
            //Console.ReadKey(); // убрать чтение из файла
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1A
{
  class ProgramCCC
  {
    static void Main(string[] args)
    {

      int n = Convert.ToInt32(Console.ReadLine());
      Console.WriteLine((n - 1) / 2);
    }

  }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace find_amer
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Console.WriteLine((n-1)/2);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CF._0411.C {
    class Program {
        static void Main(string[ ] args) {
            uint n = uint.Parse(Console.ReadLine( ));
            Console.WriteLine((n - 1) / 2u);
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

class Program
{
    private static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c < '0' || c > '9');
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res;
            res *= 10;
            res += c - '0';
        }
    }
    private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), Encoding.ASCII, false, 1024 * 10);
    private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), Encoding.ASCII, 1024 * 10);

    static string getNext(string current)
    {
        if(current.Length == 1)
        {
            var num = int.Parse(current);
            if(num < 9)
            {
                return (num + 1).ToString();
            } else
            {
                return (11).ToString();
            }
        }
        var first = int.Parse(current[0].ToString());
        var last = int.Parse(current[current.Length-1].ToString());

        var sb = new StringBuilder(current);
        for(var i = 1; i < current.Length - 1; i++)
        {
            sb[i] = '0';
        }

        if (last < first)
        {
            last = first;

            sb[current.Length - 1] = char.Parse(last.ToString());
            return sb.ToString();
        } else
        {
            first++;
            if(first == 10)
            {
                first = 1;
                sb.Insert(0, char.Parse(first.ToString()));
            }
            last = first;
            sb[current.Length - 1] = char.Parse(last.ToString());
            sb[0] = char.Parse(first.ToString());
            return sb.ToString();
        }

    }

    static List<int> GetAllGcd(int num)
    {
        var all = new List<int>();
        for (int i = 2; i * i <= num; i++)
        {
            if (num % i == 0)
            {
                all.Add(i);
            }
            if (num % i == 0 && num / i != i)
            {
                all.Add(num / i);
            }
        }
        return all;
    }
    static void Main(String[] args)
    {
        var n = double.Parse(Console.ReadLine());
        var result = Math.Ceiling(n / 2) - 1;
        Console.WriteLine(result);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class PairVariable : IComparable<PairVariable>
{
    public int a, b;
    public PairVariable()
    {
        a = b = 0;
    }
    public PairVariable(string s)
    {
        string[] q = s.Split();
        a = int.Parse(q[0]);
        b = int.Parse(q[1]);
    }
    public PairVariable(int a, int b)
    {
        this.a = a;
        this.b = b;
    }

    public int CompareTo(PairVariable other)
    {
        return this.a.CompareTo(other.a);
    }
}

namespace ConsoleApplication254
{

    class Program
    {

        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            ulong n = ulong.Parse(ss[0]);
            if (n % 2 == 0)
            {

                Console.WriteLine(n / 2 - 1);

                return;
            }
            Console.WriteLine(n/2);
        }
    }
}

using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Numerics;

namespace cf411
{
    class Program
    {
        static void Main(string[] args)
        {
            //Console.SetIn(new StreamReader("input.txt"));
            solve_cf411C();
        }
        public static void solve_cf411C()
        {
            int n = Convert.ToInt32(Console.ReadLine());

            int i = 2;
            int j = n;
            int min = 0;
            while (i < j)
            {
                min += (i + j) % (n + 1);
                i++;
                j--;
            }

            Console.WriteLine(min);
            //Maybe formula does not exists
            //Console.WriteLine(n < 2 ? 0 : (n + 2) / 3);
        }

        public static void solve_cf411B()
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int k = 2;
            int s = 1;
            List<char> ans = new List<char>();
            for (int i = 0; i < n; i++)
            {
                if (k <= i)
                {
                    k += 2;
                    s = s == 1 ? 2 : 1;
                }

                if (s == 1)
                {
                    ans.Add('a');
                }
                else
                {
                    ans.Add('b');
                }
            }

            Console.WriteLine(new String(ans.ToArray()));
        }

    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
using System.Linq;

class Program
{
    static void Main()
    {
        new Magatro().Solve();
    }
}

public class Scanner
{
    private StreamReader Sr;

    private string[] S;
    private int Index;
    private const char Separator = ' ';

    public Scanner(Stream source)
    {
        Index = 0;
        S = new string[0];
        Sr = new StreamReader(source);
    }

    private string[] Line()
    {
        return Sr.ReadLine().Split(Separator);
    }

    public string Next()
    {
        string result;
        if (Index >= S.Length)
        {
            S = Line();
            Index = 0;
        }
        result = S[Index];
        Index++;
        return result;
    }
    public int NextInt()
    {
        return int.Parse(Next());
    }
    public double NextDouble()
    {
        return double.Parse(Next());
    }
    public long NextLong()
    {
        return long.Parse(Next());
    }
    public decimal NextDecimal()
    {
        return decimal.Parse(Next());
    }
    public string[] StringArray(int index = 0)
    {
        Next();
        Index = S.Length;
        return S.Skip(index).ToArray();
    }
    public int[] IntArray(int index = 0)
    {
        return StringArray(index).Select(int.Parse).ToArray();
    }
    public long[] LongArray(int index = 0)
    {
        return StringArray(index).Select(long.Parse).ToArray();
    }
    public bool EndOfStream
    {
        get { return Sr.EndOfStream; }
    }
}

class Magatro
{
    private int N;
    private void Scan()
    {
        var cin = new Scanner(Console.OpenStandardInput());
        N = cin.NextInt();
    }
    public void Solve()
    {
        Scan();
        int c = (N + 1) / 2;
        Console.WriteLine(c - 1);
    }
}

using System;
using System.Collections;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication
{
    public class Program
    {
        public static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Console.WriteLine(n % 2 == 0 ? n / 2 - 1 : n / 2);
        }
    }
}

using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
class Solve{
    public Solve(){}
    StringBuilder sb;
    public static int Main(){
        new Solve().Run();
        return 0;
    }
    void Run(){
        sb = new StringBuilder();
        Calc();
        Console.Write(sb.ToString());
    }
    void Calc(){
        int N = int.Parse(Console.ReadLine());
        sb.Append((N-1)/2+"\n");
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){

		Console.WriteLine((N-1)/2);

	}
	int N;
	public Sol(){
		N = ri();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}

class Pair : IComparable<Pair> {
	public int Pos;
	public long Cost;
	public Pair(int p, long c) {
		Pos = p; Cost = c;
	}
	public int CompareTo(Pair t) {
		//return this.Cost > t.Cost ? -1 : this.Cost < t.Cost ? 1 : 0;
		return this.Cost > t.Cost ? 1 : this.Cost < t.Cost ? -1 : 0;
	}
}

class SkewHeap<T> where T:IComparable<T>{
	public int Count{
		get{return cnt;}
		private set{cnt=value;}
	}

	public SkewHeap(){
		root=null;
		this.Count=0;
	}

	public void Push(T v){
		NodeSH<T> p=new NodeSH<T>(v);
		root=NodeSH<T>.Meld(root,p);
		this.Count++;
	}

	public void Pop(){
		if(root==null)return;
		root=NodeSH<T>.Meld(root.L,root.R);
		this.Count--;
	}

	public T Top{
		get{return root.Val;}
	}

	int cnt;
	NodeSH<T> root;

	class NodeSH<S> where S : IComparable<S> {
		public NodeSH<S> L, R;
		public S Val;

		public NodeSH(S v){
			Val = v;
			L = null; R = null;
		}
		public static NodeSH<S> Meld(NodeSH<S> a, NodeSH<S> b){
			if(a == null)return b;
			if (b == null) return a;
			if (a.Val.CompareTo(b.Val) > 0) swap(ref a, ref b);
			a.R = Meld(a.R, b);
			swap(ref a.L, ref a.R);
			return a;
		}

		static void swap<U>(ref U x, ref U y) {
			U t = x; x = y; y = t;
		}
	}
}

/* Date: 06.05.2017 * Time: 21:45 */

using System;
using System.IO;
using System.Globalization;

class Example
{
	public static void Main (string[] args)
	{
		int n = int.Parse (Console.ReadLine ());
		Console.Write (((n - 1)/2));
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Globalization;
using System.Diagnostics;
using static System.Console;
using Pair = System.Collections.Generic.KeyValuePair<int, int>;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().Solve();
        Out.Flush();
    }
    Scanner cin = new Scanner();
    Random rnd = new Random();
    Stopwatch sw = new Stopwatch();
    readonly int[] dd = { 0, 1, 0, -1, 0 };
    readonly int mod = 1000000007;
    readonly string alfa = "abcdefghijklmnopqrstuvwxyz";

    int N;
    void Solve()
    {
        N = cin.Nextint;
        if (N % 2 == 0)
        {
            int d = N / 2;
            WriteLine(d - 1);
        }
        else
        {
            int d = N / 2;
            WriteLine(d);
        }
    }

}

class Scanner
{
    string[] s; int i;
    char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] Scan { get { return ReadLine().Split(); } }
    public int[] Scanint { get { return Array.ConvertAll(Scan, int.Parse); } }
    public long[] Scanlong { get { return Array.ConvertAll(Scan, long.Parse); } }
    public double[] Scandouble { get { return Array.ConvertAll(Scan, double.Parse); } }
    public string Next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return Next;
        }
    }
    public int Nextint { get { return int.Parse(Next); } }
    public long Nextlong { get { return long.Parse(Next); } }
    public double Nextdouble { get { return double.Parse(Next); } }
}

using System;
using System.Collections.Generic;

namespace CodeForces
{
    static class Program
    {
        static void Main()
        {
            const string filePath = @"Data\R411С2.txt";
            if (System.IO.File.Exists(filePath))
            {
                Console.SetIn(new System.IO.StreamReader(filePath));
            }

            IProblem counter = new R411С();

            foreach (var result in counter.GetResults())
            {
                Console.WriteLine(result);
            }
        }
    }

    internal class R411С : ProblemBase
    {
        public override IEnumerable<string> GetResults()
        {
            var n = this.ReadInt32();
            if (n % 2 == 1)
            {
                yield return (n / 2).ToString();
            }
            else
            {
                yield return (n / 2 - 1).ToString();
            }
        }
    }

    abstract class MultipleTestsBase : ProblemBase
    {
        public sealed override IEnumerable<string> GetResults()
        {
            var t = Convert.ToInt32(Console.ReadLine());
            for (int testCaseNumber = 0; testCaseNumber < t; testCaseNumber++)
            {
                foreach (var result in this.GetTestResult(testCaseNumber + 1))
                {
                    yield return result;
                }

            }

        }

        protected abstract IEnumerable<string> GetTestResult(int caseNumber);
    }

    public interface IProblem
    {
        IEnumerable<string> GetResults();
    }

    public abstract class ProblemBase : IProblem
    {
        /// <summary>
        /// Pring array of T
        /// </summary>
        /// <typeparam name="T">Generic paramter.</typeparam>
        /// <param name="items">The items.</param>
        /// <param name="prefixMessage">The message shown first.</param>
        public void PrintArray<T>(IEnumerable<T> items, string prefixMessage)
        {
            Console.WriteLine("{0}: {1}", prefixMessage, string.Join(",", items));
        }

        public void WriteDiagnostics(string message, params object[] objects)
        {
            Console.WriteLine(message, objects);
        }

        public virtual IEnumerable<string> GetResults()
        {
            yield return "No result";
        }

        protected int[] ReadIntArray()
        {
            return Array.ConvertAll(ReadTokens(), Convert.ToInt32);
        }

        protected string[] ReadTokens()
        {
            var readLine = Console.ReadLine();
            if (readLine == null)
            {
                throw new Exception("Value read from Console is null");
            }
            return readLine.Split(' ');
        }

        protected int ReadInt32()
        {
            return Convert.ToInt32(Console.ReadLine());
        }
    }
}

using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;

namespace ConsoleApp23
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Console.WriteLine((n-1)/2);

        }

    }
}

using System;

public class Solve
{
	static void Main()
    {
        int n=Convert.ToInt32(Console.ReadLine());
        Console.WriteLine("{0}",(n-1)/2);
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Codeforces
{

    class Node
    {
        public int Val { get; set; }
        public List<Node> Nodes { get; set; }
    }

    class Program
    {

        public void Solve()
        {
            var n = int.Parse(Console.ReadLine());
            var res = (n - 1) / 2;
            Console.WriteLine(res);

        }

        static void Main(string[] args)
        {
            var p = new Program();
            p.Solve();
            //Console.ReadLine();
        }
    }
}

using System;
  public class Program
    {
        public static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Console.WriteLine((n / 2 - (n%2==0?1:0)));
        }
    }

using System;
using System.Linq;
using System.Collections.Generic;
using Debug = System.Diagnostics.Debug;
using StringBuilder = System.Text.StringBuilder;
using Number = System.Int64;
namespace Program
{
    public class Solver
    {
        public void Solve()
        {
            var n = sc.Integer();
            IO.Printer.Out.WriteLine((n - 1) / 2);
        }

        public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());
        static T[] Enumerate<T>(int n, Func<int, T> f) { var a = new T[n]; for (int i = 0; i < n; ++i) a[i] = f(i); return a; }
        static public void Swap<T>(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }
    }
}

#region main
static class Ex
{
    static public string AsString(this IEnumerable<char> ie) { return new string(System.Linq.Enumerable.ToArray(ie)); }
    static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") { return string.Join(st, ie); }
    static public void Main()
    {
        var solver = new Program.Solver();
        solver.Solve();
        Program.IO.Printer.Out.Flush();
    }
}
#endregion
#region Ex
namespace Program.IO
{
    using System.IO;
    using System.Text;
    using System.Globalization;
    public class Printer: StreamWriter
    {
        static Printer() { Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false }; }
        public static Printer Out { get; set; }
        public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
        public Printer(System.IO.Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
        public Printer(System.IO.Stream stream, Encoding encoding) : base(stream, encoding) { }
        public void Write<T>(string format, T[] source) { base.Write(format, source.OfType<object>().ToArray()); }
        public void WriteLine<T>(string format, T[] source) { base.WriteLine(format, source.OfType<object>().ToArray()); }
    }
    public class StreamScanner
    {
        public StreamScanner(Stream stream) { str = stream; }
        public readonly Stream str;
        private readonly byte[] buf = new byte[1024];
        private int len, ptr;
        public bool isEof = false;
        public bool IsEndOfStream { get { return isEof; } }
        private byte read()
        {
            if (isEof) return 0;
            if (ptr >= len) { ptr = 0; if ((len = str.Read(buf, 0, 1024)) <= 0) { isEof = true; return 0; } }
            return buf[ptr++];
        }
        public char Char() { byte b = 0; do b = read(); while ((b < 33 || 126 < b) && !isEof); return (char)b; }

        public string Scan()
        {
            var sb = new StringBuilder();
            for (var b = Char(); b >= 33 && b <= 126; b = (char)read())
                sb.Append(b);
            return sb.ToString();
        }
        public string ScanLine()
        {
            var sb = new StringBuilder();
            for (var b = Char(); b != '\n'; b = (char)read())
                if (b == 0) break;
                else if (b != '\r') sb.Append(b);
            return sb.ToString();
        }
        public long Long()
        {
            if (isEof) return long.MinValue;
            long ret = 0; byte b = 0; var ng = false;
            do b = read();
            while (b != 0 && b != '-' && (b < '0' || '9' < b));
            if (b == 0) return long.MinValue;
            if (b == '-') { ng = true; b = read(); }
            for (; true; b = read())
            {
                if (b < '0' || '9' < b)
                    return ng ? -ret : ret;
                else ret = ret * 10 + b - '0';
            }
        }
        public int Integer() { return (isEof) ? int.MinValue : (int)Long(); }
        public double Double() { var s = Scan(); return s != "" ? double.Parse(s, CultureInfo.InvariantCulture) : double.NaN; }
        private T[] enumerate<T>(int n, Func<T> f)
        {
            var a = new T[n];
            for (int i = 0; i < n; ++i) a[i] = f();
            return a;
        }

        public char[] Char(int n) { return enumerate(n, Char); }
        public string[] Scan(int n) { return enumerate(n, Scan); }
        public double[] Double(int n) { return enumerate(n, Double); }
        public int[] Integer(int n) { return enumerate(n, Integer); }
        public long[] Long(int n) { return enumerate(n, Long); }
    }
}
#endregion

using System;

class A804 {
    public static void Main() {
        var n = int.Parse(Console.ReadLine());
        Console.WriteLine((n - 1) >> 1);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pr1
{
    class Program
    {
        static void Main()
        {
            int n=Convert.ToInt32(Console.ReadLine());
            Console.Write(Math.Ceiling((double)n/2)-1);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Xml.Schema;

namespace CodeForces
{
    class Program
    {
        static void Main()
        {
            int inputData = int.Parse(Console.ReadLine());
            if(inputData == 1)
                Console.WriteLine(0);
            else if (inputData % 2 == 1)
                Console.WriteLine((inputData-1)/2);
            else
                Console.WriteLine(inputData/2 - 1);
        }
    }
}

using System;
using System.IO;
using System.Text;

namespace Find_Amir
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int n = Next();

            writer.WriteLine((n - 1)/2);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;

namespace _804A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int result = (n + 1) / 2 - 1;
            Console.WriteLine(result);
            Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Fuck
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            n = int.Parse(Console.ReadLine());
            if (n % 2 == 0)
                Console.WriteLine(n / 2 - 1);
            else
                Console.WriteLine(n / 2);
        }
    }
}

// Problem: 804A - Find Amir
// Author: Gusztav Szmolik

using System;

namespace Find_Amir
	{
	class Program
		{
		static int Main ()
			{
			string[] tmp = Console.ReadLine().Split();
			if (tmp.Length != 1)
				return -1;
			uint n = 0;
			if (!UInt32.TryParse(tmp[0], out n))
				return -1;
			if (n < 1 || n > 100000)
				return -1;
			ushort minCost = (n%2 == 1 ? Convert.ToUInt16((n-1)/2) : Convert.ToUInt16((n-2)/2));
			Console.WriteLine (minCost);
			return 0;
			}
		}
	}

namespace ZTCodeforces
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    public static class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine(new FindAmir().Solve(new TextInputHelper(Console.In)));
        }
    }

    internal class FindAmir : CodeforcesSolverBase
    {
        public string Solve(InputHelper input)
        {
            int n = input.Read<int>();
            return ((n - 1) / 2).ToString();
        }
    }

    internal interface CodeforcesSolverBase
    {
        string Solve(InputHelper input);
    }

    public abstract class InputHelper
    {
        private string data;
        private IEnumerator<string> current;

        public T Read<T>()
        {
            ThrowIfNoNext();
            lock (data)
            {
                var r = data;
                data = null;
                return (T)Convert.ChangeType(r, typeof(T));
            }
        }

        public bool HasNext()
        {
            return data != null || EnsureData();
        }

        /// <summary>
        /// Gets the next group of tokens. Returns null if no more groups are available.
        /// </summary>
        /// <returns>Next group or null.</returns>
        protected abstract IEnumerable<string> GetNextGroup();

        private void ThrowIfNoNext()
        {
            if (!HasNext())
            {
                throw new InvalidOperationException("no more data");
            }
        }

        private bool EnsureData()
        {
            if (data == null)
            {
                while (current == null || !current.MoveNext())
                {
                    var next = GetNextGroup();

                    if (next == null)
                    {
                        return false;
                    }

                    current = next.GetEnumerator();
                }

                data = current.Current;
            }

            return true;
        }
    }

    public class TextInputHelper : InputHelper
    {
        private TextReader reader;

        public TextInputHelper(TextReader reader)
        {
            this.reader = reader;
        }

        protected override IEnumerable<string> GetNextGroup()
        {
            if (this.reader == null)
            {
                return null;
            }
            var cur = this.reader;
            this.reader = null;
            return cur.ReadWordsToEnd();
        }
    }

    internal static class Extensions
    {
        public const int Mod = 1000000007;

        /// <summary>
        /// Reads to end for the words separated by spaces from the reader.
        /// </summary>
        /// <param name="reader">Text source to read.</param>
        /// <returns>A list of words.</returns>
        public static IEnumerable<string> ReadWordsToEnd(this TextReader reader)
        {
            for (var lines = reader.ReadWords(); lines != null; lines = reader.ReadWords())
                foreach (string word in lines)
                    yield return word;
        }

        /// <summary>
        /// Reads a line through the reader and returns the words separated by spaces.
        /// </summary>
        /// <param name="reader">Text source to read.</param>
        /// <returns>A list of words or null.</returns>
        public static IEnumerable<string> ReadWords(this TextReader reader)
        {
            string line = reader.ReadLine();
            return line == null ? null : line.Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;

class Program
{
    private static void Main(string[] args)
    {
        SolveA();
    }

    private static void SolveA()
    {
        long n = RL();
        var ans = (n - 1) / 2;
        Console.WriteLine(ans);

    }

    private const int Mod = 1000000000 + 7;

    #region Data Read

    private static long GCD(long a, long b)
    {
        if (a % b == 0) return b;
        return GCD(b, a % b);
    }

    private static List<int>[] ReadGraph(int n, int m)
    {
        List<int>[] g = new List<int>[n];
        for (int i = 0; i < g.Length; i++) g[i] = new List<int>();
        for (int i = 0; i < m; i++)
        {
            int a = RI() - 1;
            int b = RI() - 1;

            g[a].Add(b);
            g[b].Add(a);
        }

        return g;
    }

    private static int[,] ReadGraphAsMatrix(int n, int m)
    {
        int[,] matrix = new int[n + 1, n + 1];
        for (int i = 0; i < m; i++)
        {
            int a = RI();
            int b = RI();
            matrix[a, b] = matrix[b, a] = 1;
        }

        return matrix;
    }

    private static void Sort(ref int a, ref int b)
    {
        if (a > b) Swap(ref a, ref b);
    }

    private static void Swap(ref int a, ref int b)
    {
        int tmp = a;
        a = b;
        b = tmp;
    }

    private const int BufferSize = 1 << 16;
    private static StreamReader consoleReader;
    private static MemoryStream testData;

    private static int RI()
    {
        int ans = 0;
        int mul = 1;
        do
        {
            ans = consoleReader.Read();
            if (ans == -1)
                return 0;
            if (ans == '-') mul = -1;
        } while (ans < '0' || ans > '9');

        ans -= '0';
        while (true)
        {
            int chr = consoleReader.Read();
            if (chr < '0' || chr > '9')
                return ans * mul;
            ans = ans * 10 + chr - '0';
        }
    }

    private static ulong RUL()
    {
        ulong ans = 0;
        int chr;
        do
        {
            chr = consoleReader.Read();
            if (chr == -1)
                return 0;
        } while (chr < '0' || chr > '9');

        ans = (uint)(chr - '0');
        while (true)
        {
            chr = consoleReader.Read();
            if (chr < '0' || chr > '9')
                return ans;
            ans = ans * 10 + (uint)(chr - '0');
        }
    }

    private static long RL()
    {
        long ans = 0;
        int mul = 1;
        do
        {
            ans = consoleReader.Read();
            if (ans == -1)
                return 0;
            if (ans == '-') mul = -1;
        } while (ans < '0' || ans > '9');

        ans -= '0';
        while (true)
        {
            int chr = consoleReader.Read();
            if (chr < '0' || chr > '9')
                return ans * mul;
            ans = ans * 10 + chr - '0';
        }
    }

    private static int[] RIA(int n)
    {
        int[] ans = new int[n];
        for (int i = 0; i < n; i++)
            ans[i] = RI();
        return ans;
    }

    private static long[] RLA(int n)
    {
        long[] ans = new long[n];
        for (int i = 0; i < n; i++)
            ans[i] = RL();
        return ans;
    }

    private static char[] ReadWord()
    {
        int ans;

        do
        {
            ans = consoleReader.Read();
        } while (!((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z')));

        List<char> s = new List<char>();
        do
        {
            s.Add((char)ans);
            ans = consoleReader.Read();
        } while ((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z'));

        return s.ToArray();
    }

    private static char[] ReadString(int n)
    {
        int ans;

        do
        {
            ans = consoleReader.Read();
        } while (!((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z')));

        char[] s = new char[n];
        int pos = 0;
        do
        {
            s[pos++] = (char)ans;
            if (pos == n) break;
            ans = consoleReader.Read();
        } while ((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z'));

        return s;
    }

    private static char[] ReadStringLine()
    {
        int ans;

        do
        {
            ans = consoleReader.Read();
        } while (ans == 10 || ans == 13);

        List<char> s = new List<char>();

        do
        {
            s.Add((char)ans);
            ans = consoleReader.Read();
        } while (ans != 10 && ans != 13 && ans != -1);

        return s.ToArray();
    }

    private static char ReadLetter()
    {
        while (true)
        {
            int ans = consoleReader.Read();
            if ((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z'))
                return (char)ans;
        }
    }
    private static char ReadNonLetter()
    {
        while (true)
        {
            int ans = consoleReader.Read();
            if (!((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z')))
                return (char)ans;
        }
    }

    private static char ReadAnyOf(IEnumerable<char> allowed)
    {
        while (true)
        {
            char ans = (char)consoleReader.Read();
            if (allowed.Contains(ans))
                return ans;
        }
    }

    private static char ReadDigit()
    {
        while (true)
        {
            int ans = consoleReader.Read();
            if (ans >= '0' && ans <= '9')
                return (char)ans;
        }
    }

    private static int ReadDigitInt()
    {
        return ReadDigit() - (int)'0';
    }

    private static char ReadAnyChar()
    {
        return (char)consoleReader.Read();
    }

    private static string DoubleToString(double x)
    {
        return x.ToString(CultureInfo.InvariantCulture);
    }

    private static double DoubleFromString(string x)
    {
        return double.Parse(x, CultureInfo.InvariantCulture);
    }

    static Program()
    {
        //Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
        consoleReader = new StreamReader(Console.OpenStandardInput(BufferSize), Encoding.ASCII, false, BufferSize);
    }

    private static void PushTestData(StringBuilder sb)
    {
        PushTestData(sb.ToString());
    }
    private static void PushTestData(string data)
    {
#if TOLYAN_TEST
        if (testData == null)
        {
            testData = new MemoryStream();
            consoleReader = new StreamReader(testData);
        }

        var pos = testData.Position;
        var bytes = Encoding.UTF8.GetBytes(data);
        testData.Write(bytes, 0, bytes.Length);
        testData.Flush();
        testData.Position = pos;
#endif
    }
    #endregion
}

using System;

namespace CSharp
{
    public class _804A
    {
        public static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Console.WriteLine((n + 1) / 2 - 1);
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;

public static class P
{
    public static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        Console.WriteLine(n / 2 - 1 + n % 2);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Find_Amir
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Console.WriteLine((n - 1) / 2);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _804A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Console.WriteLine(n % 2 == 0 ? n / 2 - 1 : (n - 1) / 2);
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Globalization;
using System.Diagnostics;

class Myon
{
    public Myon() { }
    public static int Main()
    {
        new Myon().calc();
        return 0;
    }

    Scanner cin;

    void calc()
    {
        cin = new Scanner();
        int N = cin.nextInt();
        Console.WriteLine((N - 1) / 2);
    }

}

class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }

}

using System;

namespace First
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            n = Convert.ToInt32(Console.ReadLine());
            if(n % 2 == 0)
            {
                Console.WriteLine(n / 2 - 1);
            }
            else
            {
                Console.WriteLine(n / 2);
            }
        }
    }
}

using System;
class P {
    static void Main() {
        int n = int.Parse(Console.ReadLine());
        Console.WriteLine(n % 2 == 0 ? n / 2 - 1 : n / 2 - 1 + (n + 1) / 2);
    }
}

using System;
class P {
    static void Main() {
        int n = int.Parse(Console.ReadLine());
        Console.WriteLine(n % 2 == 0 ? n / 2 - 1 : n / 2 + 1);
    }
}

using System;
class P {
    static void Main() {
        int n = int.Parse(Console.ReadLine());
        Console.WriteLine(n % 2 == 0 ? n / 2 - 1 : (n + 1) / 2);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class PairVariable : IComparable<PairVariable>
{
    public int a, b;
    public PairVariable()
    {
        a = b = 0;
    }
    public PairVariable(string s)
    {
        string[] q = s.Split();
        a = int.Parse(q[0]);
        b = int.Parse(q[1]);
    }
    public PairVariable(int a, int b)
    {
        this.a = a;
        this.b = b;
    }

    public int CompareTo(PairVariable other)
    {
        return this.a.CompareTo(other.a);
    }
}

namespace ConsoleApplication254
{

    class Program
    {

        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            ulong n = ulong.Parse(ss[0]);
            if (n == 1)
            {
                Console.WriteLine(1);
                return;
            }
            ulong ans = 0;
            for (ulong i = 3; i <= n; i++)
            {
                if (i % 2 != 0)
                {
                    ulong start = i + i + 1;
                    ulong end = n + i;
                    ans += ((end + start) * (end - start + 1)) / 2;
                }

            }
            //Console.WriteLine(ans);
            Console.WriteLine(ans % (n + 1));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class PairVariable : IComparable<PairVariable>
{
    public int a, b;
    public PairVariable()
    {
        a = b = 0;
    }
    public PairVariable(string s)
    {
        string[] q = s.Split();
        a = int.Parse(q[0]);
        b = int.Parse(q[1]);
    }
    public PairVariable(int a, int b)
    {
        this.a = a;
        this.b = b;
    }

    public int CompareTo(PairVariable other)
    {
        return this.a.CompareTo(other.a);
    }
}

namespace ConsoleApplication254
{

    class Program
    {

        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            long n = long.Parse(ss[0]);
            long ans = 0;
            for (int i = 3; i <= n; i++)
            {
                if (i % 2 != 0)
                {
                    long start = i + i + 1;
                    long end = n + i;
                    ans += ((end + start) * (end - start + 1)) / 2;
                }

            }
            //Console.WriteLine(ans);
            Console.WriteLine(ans % (n + 1));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class PairVariable : IComparable<PairVariable>
{
    public int a, b;
    public PairVariable()
    {
        a = b = 0;
    }
    public PairVariable(string s)
    {
        string[] q = s.Split();
        a = int.Parse(q[0]);
        b = int.Parse(q[1]);
    }
    public PairVariable(int a, int b)
    {
        this.a = a;
        this.b = b;
    }

    public int CompareTo(PairVariable other)
    {
        return this.a.CompareTo(other.a);
    }
}

namespace ConsoleApplication254
{

    class Program
    {

        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            ulong n = ulong.Parse(ss[0]);
            if (n == 1)
            {
                Console.WriteLine(1);
                return;
            }
            ulong ans = ((3 + n + 1) * ((n + 1) - 3 + 1)) / 2;
            /*for (ulong i = 3; i <= n; i++)
            {
                if (i % 2 != 0)
                {
                    ulong start = i + i + 1;
                    ulong end = n + i;
                    ans += ((end + start) * (end - start + 1)) / 2;
                }

            }*/
           // Console.WriteLine(ans);
            Console.WriteLine(ans % (n + 1)/2);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class PairVariable : IComparable<PairVariable>
{
    public int a, b;
    public PairVariable()
    {
        a = b = 0;
    }
    public PairVariable(string s)
    {
        string[] q = s.Split();
        a = int.Parse(q[0]);
        b = int.Parse(q[1]);
    }
    public PairVariable(int a, int b)
    {
        this.a = a;
        this.b = b;
    }

    public int CompareTo(PairVariable other)
    {
        return this.a.CompareTo(other.a);
    }
}

namespace ConsoleApplication254
{

    class Program
    {

        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            ulong n = ulong.Parse(ss[0]);
            if (n == 1)
            {
                Console.WriteLine(1);
                return;
            }

            Console.WriteLine(n/2-1);
        }
    }
}

using System;

public class Solve
{
	static void Main()
    {
        int n=Convert.ToInt32(Console.ReadLine());
        Console.WriteLine("{0}",n/2);
    }
}

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Xml.Schema;

namespace CodeForces
{
    class Program
    {
        static void Main()
        {
            int inputData = int.Parse(Console.ReadLine());
            if(inputData == 1)
                Console.WriteLine(1);
            else if (inputData % 2 == 1)
                Console.WriteLine((inputData-1)/2);
            else
                Console.WriteLine(inputData/2 - 1);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Xml.Schema;

namespace CodeForces
{
    class Program
    {
        static void Main()
        {
            int inputData = int.Parse(Console.ReadLine());
            if(inputData == 1)
                Console.WriteLine(1);
            else if (inputData % 2 == 1)
                Console.WriteLine((inputData-1)/2 - 1);
            else
                Console.WriteLine(inputData/2 - 1);
        }
    }
}

using System;
using System.IO;
using System.Text;

namespace Find_Amir
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int n = Next();

            writer.WriteLine(n/2);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}