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>
#include<vector>
#include<string>
int main() {
	int n, m;
	int s = 0;
	std::vector<int> y;
	while (true)
	{
		std::cin >> n;
		if (n == 0) {
			break;
		}
		for (int i = 0; i < n / 4; ++i) {
			std::cin >> m;
			s += m;
		}
		y.push_back(s);
		s = 0;
	}
	for (int i = 0; i < y.size();++i)
	std::cout << y[i] << std::endl;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

int n,m;

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

C++: #include <cstdio>
int main() {
	int n;
	while (scanf("%d",&n)) {
		if (n == 0) break;
		int res = 0;
		for (int i=0; i<n/4; i++) {
			int in; scanf("%d",&in);
			res += in;
		}
		printf("%d\n",res);
	}
}

C++: #include <iostream>
using namespace std;
int main(){
    int a,c,tmp;
    while(cin>>a,a){
        c=0;
        for(int i=0;i<a/4;i++){
            cin>>tmp;
            c+=tmp;
        }
        cout<<c<<endl;
    }
}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef pair<int,int> pint;
typedef pair<long long, long long> pll;

#define MP make_pair
#define PB push_back
#define ALL(s) (s).begin(),(s).end()
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) 
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P) 
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) 
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s; }



int n, a;

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

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<iomanip>
using namespace std;
#define pi 3.141592653589793283462
int main(){
	int m,n,p;
	p=0;
	while (1)
	{
		cin>>n;
		if(n==0)
			break;
		for(int i=0;i<n/4;i++){
			cin>>m;
			p+=m;
		}
		cout<<p<<endl;
		m=0;
		p=0;
		n=0;
	}
	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;
		if(a>0){
			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);
		}
		else{
			break;
		}
	}
	for(int i=0;i<b;++i){
		if(e[i]==0){
			break;
		}
		std::cout<<e[i]<<std::endl;
	}
}

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

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

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

using namespace std;

int main()
{
//	cut here before submit 
//	freopen ("testcase.archery", "r", stdin );

	int n;
	while (1){
		cin >> n;
		if (n == 0 ){
			break;
		} // end if
		int i;
		int res = 0;
		int ya = 0;
		for (i = 0; i < n/4; ++i){
			cin >> ya;
			res += ya;
		} // end for
		cout << res << endl;
	} // end loop
		
	return 0;
}

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

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

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<map>
#include<vector>
#include<deque>
using namespace std;

int main() {

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

    }
     
    return 0;
}

C++: #include <stdio.h>
#include <vector>
#include <iostream>
#include <string>
using namespace std;

int main(void) {
	vector<int> r;
	while (true)
	{
		int n=0;
		int sum=0;
		scanf("%d",&n);
		if (n==0){
			break;
		}
		for (int i=0; i<n/4; i++)
		{
			int x;
			scanf("%d", &x);
			sum += x;
		}
		r.push_back(sum);
	}
	for(int i=0; i<r.size(); i++)
	{
		cout << r[i] << endl;
	}
	return 0;
}

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

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

C++: #include<bits/stdc++.h>
#include<unordered_map>
using namespace std;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll inf=1e9+7;
const ll mod=998244353;
int main(){
    while(1){
        ll n;cin>>n;
        if(n==0)break;
        ll sum=0;
        rep(i,n/4){
            ll a;cin>>a;
            sum+=a;
        }
        cout<<sum<<endl;
    }
}

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

int main(){

  int n,a,sum = 0,avg;

  while(cin >> n, n){

    sum = 0;

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

    cout << sum << endl;
  }
}