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)
	}
}

C++: #include <bits/stdc++.h>

using namespace std;

template <typename T>
using vec1 = vector<T>;

template <typename T>
T cin2var()
{
    T val;
    cin >> val;
    return val;
}

template <typename T>
vec1<T> cin2vec(size_t size)
{
    vec1<T> vec1;
    for (size_t i = 0; i < size; ++i) {
        vec1.push_back(cin2var<T>());
    }
    return vec1;
}

int main()
{
    while (true) {
        const auto N(cin2var<int>());
        if (!N) break;
        const auto hits(cin2vec<int>(N / 4));
        const auto sum = accumulate(hits.cbegin(), hits.cend(), 0);
        cout << sum << endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;

int main(){
  while(1){
    int i,n;
    int point;
    cin >> n;
    if(n==0)break;
    int total = 0;
    for(i = 1; i <= n/4; i++){
      cin >> point;
      total+=point;
    }
    cout << total << endl;
  }
  return 0;
}

C++: #include<bits//stdc++.h>
using namespace std;
int main(){
    int n,a,sum;
    while(cin >> n,n){
        sum = 0;
        for(int i = 0;i <n/4;i++){
            cin >> a;sum += a;
        }cout << sum << endl;
    }
}

C++: #include<stdio.h>
int main(){
  int n,m[10000],i,sum;
  while(1){
    sum=0;
    scanf("%d",&n);
    if(n==0)break;
    for(i=0;i<n/4;i++){
      scanf("%d",&m[i]);
      sum+=m[i];
    }
    printf("%d\n",sum);
  }
  return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <string>
#include <algorithm>
#include <string>
#include <climits>
#include <utility>

#define REP(i, n) for (int (i) = 0; (i) < (int)(n); (i)++)
#define REG(i, a, b) for (int (i) = ((int)(a)); (i) < ((int)(b)); i++)
#define ALL(V) (V).begin(), (V).end()
#define PRINT(STR) cout << (STR) << endl
#define ROUNDED(N) fixed << setprecision(N)
#define SPACE " "

typedef long long ll;
using namespace std;

int nextInt() { int n; cin >> n; return n; }
double nextDouble() { double d; cin >> d; return d; }
string nextString() { string str; cin >> str; return str; }

int main() {
	cin.tie(0); //?????±?????????????????????
	ios::sync_with_stdio(false); //printf??¨??±??????????????????

	int n;
	while (n = nextInt(), n) {
		int sum = 0;
		for (int i = 0; i < n / 4; i++) {
			sum += nextInt();
		}
		cout << sum << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
using namespace std;

int main(){
  int n;
  while(cin >> n){
    int sum = 0;
    for(int i=0; i<n/4; ++i){
      int tmp;
      cin >> tmp;
      sum += tmp;
    }
    cout << sum << endl;
  }
  return 0;
}

C++: #include <iostream>
int main(){
	while(1){
		int a=0,c,n;
		std::cin>>n;
		if(n==0)break;
		for(int i=0;i<n/4;i++){
			std::cin>>c;
			a+=c;
		}
		std::cout<<c<<std::endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;

int main() {
  int n;
  while(cin >> n, n) {
    int ans = 0;
    for(int i = 0; i < n/4; i++) {
      int p;
      cin >> p;
      ans += p;
    }
    cout << ans << endl;
  }
}

C++: #include <iostream>

using namespace std;

int main()
{
	int n;
	
	while( cin >> n, n)
	{
		int hit  = 0;
		
		for( int i = 1; i*4 <= n; i++)
		{
			int j;
			cin >> j;
			hit += j;
		}
		
		cout << hit << endl;
	}
	
	return 0;
}

C++: #include<iostream>
int main(){
	int n,b, m=0;
	while (true){
		std::cin >> n;
		if (n == 0)break;
		for (int i = 0; i < n/4; i++){
			std::cin >> b;
			m += b;
		}
		std::cout << m << "\n";
		m = 0;
	}
}

C++: #include<iostream>
using namespace	std;

int main() {
  int n;
  int sum;

  while(1) {
    cin >> n;
    if(n == 0) break;

    sum = 0;
    for(int i = 0; i < n/4; i++) {
      int num;
      cin >> num;
      sum += num;
    }
    cout << sum	<< endl;
  }
  return 0;
}