// Aizu Vol-10 1041: Kyudo: A Japanese Art of Archery
// 2017.8.18 bal4u@uu

#include <stdio.h>

int main()
{
	int n, i, s, c;
	while (scanf("%d", &n) && n) {
		for (s = 0, i = n >> 2; i > 0; i--) scanf("%d", &c), s += c;
		printf("%d\n", s);
	}
	return 0;
}