Trạng thái

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.

Input:

  • The 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\).

Constraints:

  • \(1≤N≤1000\)
  • All input values are integers.

Example

Sample Input 1

8

Sample Output 2

2

Sample Input 2

2

Sample Output 2

0

Sample Input 3

9

Sample Output 3

3

Explain

  • In input 1: For example, you can form a group of three students and another of five students.
  • In input 2: Sometimes you cannot form any group consisting of three or more students, regardless of how you divide the students.
Thông tin
Thông tin bài tập
Gửi bài giải
Điểm
100
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
250 M
I/O
stdin -> stdout
Tác giả
Loại đề bài
A01 - Nhập môn: Biến, hằng và phép toán
Ngôn ngữ cho phép
C, C#, C++, Java, Pascal, Python, Text