100890: [AtCoder]ABC089 A - Grouping 2

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $100$ points

Problem Statement

There are $N$ students in a school.

We will divide these students into some groups, and in each group they will discuss some themes.

You think that groups consisting of two or less students cannot have an effective discussion, so you want to have as many groups consisting of three or more students as possible.

Divide the students so that the number of groups consisting of three or more students is maximized.

Constraints

  • $1 \leq N \leq 1000$
  • All input values are integers.

Input

Input is given from Standard Input in the following format:

$N$

Output

If you can form at most $x$ groups consisting of three or more students, print $x$.


Sample Input 1

8

Sample Output 1

2

For example, you can form a group of three students and another of five students.


Sample Input 2

2

Sample Output 2

0

Sometimes you cannot form any group consisting of three or more students, regardless of how you divide the students.


Sample Input 3

9

Sample Output 3

3

Input

题意翻译

$AT$班有$N$人($N$即为你输入的数) 请将他们分组,每组有三人或三人以上 问最多有多少组 感谢$@RioBlu$的翻译

加入题单

上一题 下一题 算法标签: