#K3421. Minimum Shortcuts for City Travel

    ID: 25259 Type: Default 1000ms 256MiB

Minimum Shortcuts for City Travel

Minimum Shortcuts for City Travel

You are given n cities arranged in a circle. The cities are connected in a sequential circular manner, and the travel distance between two cities is defined as the minimum number of edges traversed between them. A shortcut is an additional connection that can be built between any two cities. Your task is to determine the minimum number of shortcuts required so that the maximum travel distance between any two cities is reduced to at most 2.

It can be shown that:

$$\text{shortcuts}(n)=\begin{cases}0, & \text{if } n \text{ is odd},\\1, & \text{if } n \text{ is even}.\end{cases}$$

In other words, when the number of cities is odd, every pair of cities can be connected with at most 2 steps, while for an even number of cities, one additional shortcut is necessary to ensure no pair of cities is more than 2 steps apart.

The input will be provided as a single integer from standard input, and the answer should be printed to standard output.

inputFormat

Input Format: The input consists of a single integer n (3 ≤ n ≤ 109), representing the number of cities arranged in a circle. The input is provided via standard input.

outputFormat

Output Format: Output a single integer representing the minimum number of shortcuts required. The output should be printed to standard output.

## sample
5
0

</p>