P23689 [AtCoder] [ABC007A] Planting Trees
入门
题目描述

Problem Description

Takahashi, a primary school student, is on a field trip to the woods. Enjoying the trip, he notices that the trees are lined up in a straight line. He recalls learning about a concept called "Planting Trees" in class. The problem he learned was, "When there are 4 trees lined up in a straight line, how many spaces are there between adjacent trees?" The answer, as shown in Figure 1, is 3 spaces.

Figure 1. There are 3 spaces between 4 trees.

During his field trip, the scene he sees resembles that problem scenario, making him want to count the number of spaces between adjacent trees. He notices that the number of trees lined up in a straight line is written in the field trip pamphlet. However, he only knows how to count the spaces between the trees manually, which could take a long time depending on the number of trees.

Therefore, he asks for your help. Given the information that there are $ n $ trees lined up in a straight line, please create a program for Takahashi that outputs the number of spaces between adjacent trees.

Input Format

The input is given from the standard input in the following format:

$ n $

  • The first line contains an integer $n\ (1\ ≦\ n\ ≦\ 10,000)$, representing the number of trees lined up in a straight line.

Output Format

Output the number of spaces between adjacent trees in one line. Ensure a newline at the end of the output.

Sample Input and Output

Sample Input #1

4

Sample Output #1

3

Sample Input #2

100

Sample Output #2

99

Sample Input #3

1

Sample Output #3

0

Notes/Hints

Sample Explanation 1

This is the case explained in the problem statement, which corresponds to the scenario he learned in class.

Sample Explanation 2

Since there are 100 trees, there are 99 spaces.

Sample Explanation 3

There is only 1 tree, so output 0. ![](http://abc007.contest.atcoder.jp/img/abc/007/1-2.png) Figure 2. Sample 3 illustration (case with 1 tree)

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
4
样例输出
3