fn main() { let mut input = String::new(); std::io::Read::read_to_string(&mut std::io::stdin(), &mut input).ok(); let input: Vec = input .split_whitespace() .map(|n| n.parse().unwrap()) .collect(); let n_total_votes: u64 = input[1..].iter().sum(); let n_confiscated = input[1..] .iter() .filter(|&n| 10 * n <= n_total_votes) .count(); println!("{}", 30 * n_confiscated); }