fn main() { let mut buf = String::new(); let mut input = { use std::io::Read; std::io::stdin().read_to_string(&mut buf).unwrap(); buf.split_whitespace() }; let n: usize = input.next().unwrap().parse().unwrap(); let a: Vec = (0..n) .map(|_| input.next().unwrap().parse().unwrap()) .collect(); let output = { let mut score = 0; let mut acceptable = true; for p in 3..=35 { if a.contains(&p) { if acceptable { score += p; } acceptable = false; } else { acceptable = true; } } score }; println!("{}", output); }