n, k = map(int, raw_input().strip().split(' ')) c = map(int, raw_input().strip().split(' ')) t = 0 for i in range(k, n, k*2): t += c[i] print t