{"raw_statement":[{"iden":"statement","content":"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.\n\nThere 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."},{"iden":"input","content":"The first line contains a single integer _n_ (1 ≤ _n_ ≤ 105) — the number of schools."},{"iden":"output","content":"Print single integer: the minimum cost of tickets needed to visit all schools."},{"iden":"examples","content":"Input\n\n2\n\nOutput\n\n0\n\nInput\n\n10\n\nOutput\n\n4"},{"iden":"note","content":"In the first example we can buy a ticket between the schools that costs ."}],"translated_statement":[{"iden":"statement","content":"几年前，Sajjad 因安全原因离开了他的学校并注册到另一所学校。现在他希望找到他的同学兼好友 Amir。\n\n有 #cf_span[n] 所学校，编号从 #cf_span[1] 到 #cf_span[n]。任意两所学校之间都可以通行，为此他需要购买一张票。学校 #cf_span[i] 和学校 #cf_span[j] 之间的票价格为  ，且可多次使用。请帮助 Sajjad 计算他访问所有学校所需的最少票价。他可以从任意学校出发，也在任意学校结束。\n\n第一行包含一个整数 #cf_span[n] (#cf_span[1 ≤ n ≤ 105]) —— 学校的数量。\n\n请输出一个整数：访问所有学校所需的最少票价。\n\n在第一个例子中，我们可以购买一张在两所学校之间、价格为  的票。"},{"iden":"input","content":"第一行包含一个整数 #cf_span[n] (#cf_span[1 ≤ n ≤ 105]) —— 学校的数量。"},{"iden":"output","content":"请输出一个整数：访问所有学校所需的最少票价。"},{"iden":"examples","content":"输入2输出0输入10输出4"},{"iden":"note","content":"在第一个例子中，我们可以购买一张在两所学校之间、价格为  的票。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of schools, labeled $ 1 $ to $ n $.  \nLet the cost of a ticket between any two distinct schools $ i $ and $ j $ be $ c_{i,j} = 1 $.\n\n**Constraints**  \n$ 1 \\leq n \\leq 10^5 $\n\n**Objective**  \nFind the minimum total cost to visit all $ n $ schools, where tickets between any pair of schools cost 1 and can be reused.  \nThis is equivalent to finding the minimum cost of a connected subgraph spanning all $ n $ vertices — i.e., a spanning tree.  \n\nThe minimum number of edges required to connect $ n $ vertices is $ n - 1 $, and each edge costs 1.  \n\nThus, the minimum cost is:  \n$$\nn - 1\n$$","simple_statement":null,"has_page_source":false}