import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Solution { /// GENERIC PART public static void main(String[] args) throws IOException { init(System.in); solve(); } private static BufferedReader reader; private static StringTokenizer tokenizer; private static void init(InputStream input) { reader = new BufferedReader(new InputStreamReader(input)); tokenizer = new StringTokenizer(""); } private static String next() throws IOException { while (!tokenizer.hasMoreTokens()) { tokenizer = new StringTokenizer(reader.readLine()); } return tokenizer.nextToken(); } private static int nextInt() throws IOException { return Integer.parseInt(next(), 10); } private static long nextLong() throws IOException { return Long.parseLong(next(), 10); } private static int nextInt(int radix) throws IOException { return Integer.parseInt(next(), radix); } private static int[] nextInts(int n) throws IOException { final int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = nextInt(); } return a; } private static double nextDouble() throws IOException { return Double.parseDouble(next()); } /// SOLUTION PART private static void solve() throws IOException { int n = nextInt(), k = nextInt(); int[] arr = nextInts(n); long c = 0; for (int i = k; i < arr.length; i += 2 * k + 1) { c += arr[i]; } System.out.print(c); } }