Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func configure(scanner *bufio.Scanner) {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
}
func getNextString(scanner *bufio.Scanner) string {
	scanned := scanner.Scan()
	if !scanned {
		panic("scan failed")
	}
	return scanner.Text()
}
func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}
func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}
func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}
func main() {
	fp := os.Stdin
	wfp := os.Stdout
	extra := 0
	if os.Getenv("I") == "IronMan" {
		fp, _ = os.Open(os.Getenv("END_GAME"))
		extra = 100
	}
	scanner := bufio.NewScanner(fp)
	configure(scanner)
	writer := bufio.NewWriter(wfp)
	defer func() {
		r := recover()
		if r != nil {
			fmt.Fprintln(writer, r)
		}
		writer.Flush()
	}()
	solve(scanner, writer)
	for i := 0; i < extra; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
}
func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	for n := getNextInt(scanner); n > 0; n = getNextInt(scanner) {
		sum := 0
		for j := 0; j < n/4; j++ {
			sum += getNextInt(scanner)
		}
		fmt.Fprintln(writer, sum)
	}
}

Python: while True:
    n = int(input())

    if n == 0:
        break
    
    on_mark = 0

    for i in range(int(n/4)):
        on_mark += int(input())
    
    print(on_mark)

Python: while True:

    inp = int(input())

    if inp == 0:
        break

    times = int(inp / 4)

    sum = 0

    for i in range(times):
        sum += int(input())

    print(sum)

Python: while True:
	n = int(input());
	if n == 0:
		break;
	
	count = 0;
	for i in range(n // 4):
		count += int(input());
	print(count);

Python: # -*- coding: utf-8 -*-
from sys import stdin

while True:
  n = int(stdin.readline().rstrip())
  if n == 0:
    break
  point = 0
  for i in range(n // 4):
    point += int(stdin.readline().rstrip())
  print(point)

Python: n=int(input())
while n:
    a=0
    for i in range(n//4):
        a+=int(input())
    print(a)
    n=int(input())

Python: while True:
    n = int(input())
    if n == 0:
        break
    
    count = 0;
    for i in range(n // 4):
        count += int(input())
    
    print(count)

Python: while True:
    n=int(input())
    A=0
    if n==0:
        break
    for i in range(n//4):
        A+=int(input())
    print(A)

Python: # AOJ 1041: Kyudo: A Japanese Art of Archery
# Python3 2018.7.6 bal4u

while True:
	n = int(input())
	if n == 0: break
	print(sum([int(input()) for i in range(n>>2)]))

Python: while True:
    num = int(input())
    if num == 0:
        break
    else:
        kei = 0
        for _ in range(int(num / 4)):
            num1 = int(input())
            kei += num1
        print(kei)

Python: while True:
    n = int(input())
    if n==0: break
    ans = 0
    for i in range(n//4):
        ans += int(input())
    print(ans)

Python: while 1:
    n=int(input())//4
    if n==0:break
    ans=0
    for i in range(n):
        ans+=int(input())
    print(ans)

Python: while True:
    game_count = int(input()) // 4
    if game_count == 0:
        break
    hit_count = 0
    
    for _ in range(game_count):
        hits = int(input())
        hit_count += hits
    print(hit_count)

Python: sum_list = []

while True:
    n = int(input())
    if n == 0:
        break

    n //= 4
    sum = 0
    for _ in range(n):
        sum += int(input())

    sum_list.append(sum)

for sum_e in sum_list:
    print(sum_e)

Python: while True:
  n = int(input())
  if n == 0:
    break
  print(sum([int(input()) for _ in range(n // 4)]))

Python: N=int(input())

while N!=0:
    s=[]
    for i in range(int(N/4)):
        s.append(int(input()))
    print(sum(s))
    N=int(input())

Python: while 1:
    n = int(input())
    if n == 0:
        break

    ans = 0
    for _ in range(n//4):
        ans += int(input())

    print(ans)

Python: def main(n):
    if n == 0:
        return False
    ans = 0
    for _ in range(int(n/4)):
        ans += int(input())
    print(ans)
    return True

while main(int(input())):
    pass

Python: while(True):
    N = int(input())
    if N==0:
        break
    time = N // 4
    goukei = 0
    for i in range(time):
        ipt = int(input())
        goukei += ipt
    print(goukei)

Python: while 1:
    n=int(input())
    if n==0:
        break
    print(sum([int(input()) for _ in range(n//4)]))

Python: while True:
    N = int(input())
    if N == 0:
        break
    else:
        N_num = N // 4
        total = 0
        for i in range(N_num):
            t = int(input())
            total += t
        print(total)

Python: def main():
    while True:
        N = int(input())
        if(N==0):
            break
        else:
            answer = 0
            for _ in range(N//4):
                answer += int(input())
            print(answer)
main()

Python: while True:
    a = int(input())
    if a == 0:
        break
    count = 0
    for _ in range(int(a / 4)):
        b = int(input())
        count += b
    print(count)

Python: while 1:
    n = int(input())
    if n == 0:
        break
    c = 0
    for i in range(n//4):
        c += int(input())
    print(c)

Python: while True:
    total_n = int(input())
    if total_n == 0:
        break
    point = 0
    trial_n = total_n // 4
    for _ in range(trial_n):
        point += int(input())
    print(point)

Python: while 1:
    n = int(input())
    if (n == 0):
        break
    cnt=[int(input()) for i in range(int(n/4))]
    print(sum(cnt))

Python: while True:
    n = int(input())
    if n == 0:
        break
    print(sum(int(input()) for i in range(n // 4)))

Python: while True:
    n = int(input())
    if n == 0:break
    print(sum([int(input()) for _ in range(int(n / 4))]))

Python: while True:
	times = int(input())
	if times == 0:
		break
	time = int(times/4)
	ans = 0
	for i in range(0,time):
		ans += int(input())
	print(ans)

Python: while True:
    TryNum = int(input())
    if TryNum == 0:
        break
    TryNum = int(TryNum / 4)
    score = 0
    for i in range(TryNum):
        num = int(input())
        score += num
    print(str(score))

Python: while 1:
    s,n=0,int(input())
    if n==0:break 
    for _ in range(n//4):s+=int(input())
    print(s)

Python: while True :
    n = int(input())
    if n == 0 :
        break
    
    sum = 0
    for i in range(int(n/4)) :
        sum += int(input())
    print(sum)

Python: while True:
  n = int(input())
  if n == 0:
    break
  print(sum([int(input()) for _ in range(n // 4)]))

Python: while True:
	n=int(input())
	if n==0:
		exit()
	ans=0
	for i in range(n//4):
		x=int(input())
		ans+=x
	print(ans)

Python: while True:
    n = int(input())
    if n == 0: break
    print(sum([int(input()) for _ in range(n)]))

Python: while True:
	n = int(input())
	n//=4
	if n == 0: 
	    break
	print(sum([int(input()) for i in range(n)]))

Python: 
while True:

    n = int(input())
    ans = 0

    if n == 0:
        break

    for i in range(n//4):
        a = int(input())
        ans += a

    print (ans)

Python: while True:
    n = int(input())
    if n == 0: break
    print(sum([int(input()) for _ in range(n//4)]))

Python: while 1:
    s,n=0,int(input())
    if n==0:break 
    print(sum([int(input()) for _ in range(n//4)]))

Python: while True:
    n = int(input())
    if n == 0: break
    print(sum([int(input()) for _ in range(n//5)]))

Python: import sys
n=int(input())
A=[]
def kyuudou(n):
    sum=0
    for i in range(n//4):
        hit=int(input())
        sum+=hit
    A.append(sum)
    ni=int(input())
    if ni==0:
        sys.exit
    else:   
        kyuudou(ni)
kyuudou(n)
for j in range(len(A)):
    print(A[j])

Python: for n in iter(input,'0'):print(sum(int(input())for _ in[0]*(int(n)//4)))