use std::io; use std::io::prelude::*; fn main() { let stdin = io::stdin(); let mut stdin_it = stdin.lock().lines(); let k = stdin_it.next().unwrap().unwrap().split_whitespace().map(|x| x.parse::().unwrap()).last().unwrap(); let costs: Vec<_> = stdin_it.next().unwrap().unwrap().split_whitespace().map(|x| x.parse::().unwrap()).collect(); let state = vec![true; costs.len()]; let mut i = k; let mut ans = 0; while i < costs.len() { ans += costs[i]; i += 1 + k * 2; } println!("{}", ans); }