Problem:
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

Solution in Rust (1.15.1) (judge verdict: Wrong Answer)

// use std::collections::HashMap;

fn solve() -> i32 {
    let _ = read();
    let s = read_line_str();
    // let mut hmap: HashMap<char, i32> = HashMap::new();

    for i in s.replace("\n", "").replace(" ", "").chars() {
        if i == 'Y' {
            println!("Four");
            return 0;
        }
    }
    println!("Three");
    return 0;
}

fn main() {
    solve();
    // let _ = read();
    // let s = read_line_str();
    // let mut hmap: HashMap<char, i32> = HashMap::new();

    // for i in s.replace("\n", "").replace(" ", "").chars() {
    //     let mut n: i32 = 0;
    //     match hmap.get(&i) {
    //         Some(k) => n = *k,
    //         None => (),
    //     }
    //     hmap.insert(i, n + 1);
    // }

    // // for (k, v) in hmap.drain() {
    // //     println!("{}:{}", k, v);
    // // }

    // if hmap.keys().len() == 3 {
    //     println!("Three");
    // } else {
    //     println!("Four");
    // }
}

fn read() -> i32 {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

// fn read_line() -> (i32, i32) {
//     let mut s = String::new();
//     std::io::stdin().read_line(&mut s).ok();
//     let v : Vec<i32> = s.trim()
//         .split_whitespace()
//         .map(|e| e.parse().ok().unwrap())
//         .collect();
//     return (v[0], v[1]);
// }

fn read_line_str() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    return s;
}