SAC '22 Code Challenge 4 P1 - Obligatory Car Problem

View as PDF

Submit solution


Points: 3
Time limit: 0.15s
Memory limit: 256M

Author:
Problem type

There are N people in Mr. DeMello's car (including himself in the driver seat) with 2 seats in each row. How many people are not adjacent to Mr. DeMello? (Assume that everyone sits as close to Mr. DeMello as possible, and adjacent means either vertically or horizontally at most 1 seat away.)

Input Specification

The first line will contain N (0 \le N \le 2^{31}), the number of people in Mr. DeMello's car.

Output Specification

Output the number of people not adjacent to Mr. DeMello.

Sample Input

15

Sample Output

12

Comments

There are no comments at the moment.