Grouping 2

AtCoder
IDabc089_a
Time2000ms
Memory256MB
Difficulty
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$ [samples]
Samples
Input #1
8
Output #1
2

For example, you can form a group of three students and another of five students.
Input #2
2
Output #2
0

Sometimes you cannot form any group consisting of three or more students, regardless of how you divide the students.
Input #3
9
Output #3
3
API Response (JSON)
{
  "problem": {
    "name": "Grouping 2",
    "description": {
      "content": "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 hav",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc089_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "There are $N$ students in a school.\nWe will divide these students into some groups, and in each group they will discuss some themes.\nYou think that groups consisting of two or less students cannot hav...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments