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 <iostream>
using namespace std;  

int main() {
  std::ios::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  int n;
  while (cin>>n) {
    if (!n) {
      break;
    }
    int ans=0;
    int cnt=0;
    while (cnt++<n/4) {
      int num;
      cin>>num;
      ans+=num;
    }
    cout<<ans<<endl;
  }
  return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
    int n=0;
    while(cin>>n){
        if(n==0)break;
        int a[n];
        int ans=0;
        for(int i=0;i<n/4;i++){
            cin>>a[i];
            ans+=a[i];
        }
        cout<<ans<<endl;
        
        
    }
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

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

C++: #include<iostream>
#include<set>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	int n;
	while (cin >> n&&n != 0) {
		int sum = 0;
		for (int i = 0; i < n / 4; i++) {
			int a;
			cin >> a;
			sum += a;
		}
		cout << sum << endl;
	}
}

C++: #include<iostream>

int main(){

	int n;
	while (std::cin >> n, n){

		int sum = 0;
		for (int i = 0, a; i < n / 4; i++){
			std::cin >> a;
			sum += a;
		}
		std::cout << sum << std::endl;
	}

	return 0;
}

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

int main(int argc, char *argv[])
{
  int N, n, sum = 0;
  vector<int> answer;
  
  while(cin >> N, N) {
    for (int i = 0; i < N/4; i++) {
      cin >> n;
      sum += n;
    }
    answer.push_back(sum);
    sum = 0;
  }

  for (int i = 0; i < answer.size(); i++) {
    cout << answer[i] << endl;
  }
  
  return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #include<iostream>
#include<vector>
using namespace std;
int main() {
	vector<int> n;
	while (true){
		int a = 0, ya = 0, b = 0;
		cin >> a;
		if (a == 0) {
			break;
		}
		for (int i = 0; i < a / 4; ++i) {
			cin >> b;
			ya += b;
		}
		n.push_back(ya);
		ya=0;
	}
	for (int i = 0; i < n.size(); ++i) {
		cout << n[i] << endl;
	}
	return 0;
}

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

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

C++: #include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
#include <functional>
#include <cctype>

using namespace std;

#define REP(i,n) for(int i = 0; i < (int)n; ++i)

int main()
{
	int n;
	int sum;
	int a;

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

		for(int i = 0; i < n / 4; ++i) {
			cin >> a;
			sum += a;
		}

		cout << sum << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
int main(){
	int a,b,c;
	c=0;
	b=1;
	std::vector<int> e(1);
	while(true){
		std::cin>>a;
			a=a/4;
			std::vector<int> v(a);
			for(int i=0;i<a;++i){
				std::cin>>v[i];
			}
			for(int i=0;i<a;++i){
				c=c+v[i];
			}
			e[b-1]=c;
			c=0;
			b=b+1;
			e.resize(b);
		
			break;
		
	}
	for(int i=0;i<b;++i){
		if(e[i]==0){
			break;
		}
		std::cout<<e[i]<<std::endl;
	}
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb(in,tmp) in.push_back(tmp)
#define all(in) in.begin(),in.end()
#define PI acos(-1)
using namespace std;
int main(){
  int n;
  while(cin>>n,n){
    int sum=0;
    rep(i,n/4){
      int tmp;
      cin>>tmp;
      sum+=tmp;
    }
    cout<<sum<<endl;
  }

}

C++: #include <iostream>
#include <vector>

using namespace std;

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

C++: #include<bits/stdc++.h>
#include <array>
using namespace std;
using ULL = unsigned long long;
using UL = unsigned;
using LL = long long;
#define rep(i, n) for(UL i = 0; i < (n); i++)

struct Problem {


	void Solve() {
		while (true) {
			UL N; cin >> N;
			if (N == 0) break;
			UL ans = 0;
			rep(i, N / 4) {
				UL a; cin >> a;
				ans += a;
			}
			cout << ans << endl;
		}

	}


	Problem();
};
int main() {
	unique_ptr<Problem> p(new Problem());
	p->Solve();
	return 0;
}
Problem::Problem() {
	cout << fixed << setprecision(10);
}

C++: //18
#include<iostream>

using namespace std;

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

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

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

    return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	int N;
	for(;cin>>N, N;)
	{
		int sum = 0;
		N /= 4;
		for (;N-->0;) { int c; cin >> c, sum += c; }
		cout << sum << endl;
	}
	return 0;
}

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

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