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()
{
  int n,a,ans;
  int i;
  while(1){
    cin >> n;
    if(n==0) break;
    ans=0;
    for(i=0;i<n/4;++i){
      cin >> a;
      ans += a;
    }
    cout << ans << endl;
  }
  return 0;
}

C++: #include <iostream>

int main() {
	int n;
	
	while (std::cin >> n, n) {
		int ans = 0;

		for (int i = 0; i < n / 4; ++i) {
			int x;
			std::cin >> x;

			ans += x;
		}

		std::cout << ans << std::endl;
	}
}

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

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define DEBUGP(val) cerr << #val << "=" << val << "\n"

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PI;
const ll mod = 1e9 + 7;



int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  while (cin >> n && n) {
    n /= 4;
    int tot = 0;
    REP(i, 0, n) {
      int x;
      cin >> x;
      tot += x;
    }
    cout << tot << endl;
  }
}

C++: #include <iostream>
using namespace std;
int main(){
  int n;
  while(cin>>n,n){
    int s=0,a;
    while(n){
n-=4;
      cin>>a;
      s+=a;
    }
    cout<<s<<endl;
  }
}

C++: #include <bits/stdc++.h>
using namespace std;

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

    return 0;
}

C++: #include<iostream>
using namespace std;int l,h,a;int main(){for(;l>0;cin>>l){h=0;for(;l>0;l=l-4){cin>>a;h+=a;}cout<<h<<endl;}}

C++: #include <iostream>

using namespace std;

void solve()
{
	int n;
	while(cin >> n, n)
	{
		int sum = 0;
		for(int i = 0; i < n / 4; ++i)
		{
			int temp;
			cin >> temp;
			sum += temp;
		}
		cout << sum << endl;
	}
}

int main()
{
	solve();
	return(0);
}

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

C++: // AOJ 1041
#include<cstdio>

int main()
{
	int n;
	while( scanf( "%d", &n ), n )
	{
		int sum = 0;
		for( int i = 0; i != n/4; ++i )
		{
			int a; scanf( "%d", &a );
			sum += a;
		}
		printf( "%d\n", sum );
	}

	return 0;
}

C++: #include<stdio.h>
 
int main(){
	int a, b, i, ans = 0;
	while(scanf("%d", &a) != 0){
		if(a == 0) break;
		for(i = 0; i < a / 4; i++){
			scanf("%d", &b);
			ans += b;
		}
		printf("%d\n", ans);
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>

#define PI 3.14159265359

#define INF 99999999;

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

typedef long long ll;

using namespace std;



/*
class LightSwitchingPuzzle
{
public:
	int minFlips(string s)
	{

	}
}
*/


int main()
{
	int n, num, sum;
	
	while (cin >> n)
	{
		if (n == 0) break;
		
		sum = 0;
		
		REP(n / 4)
		{
			cin >> num;
			sum += num;
		}
		
		cout << sum << endl;
	}
	
	return 0;
}

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

using namespace std;

int *b;

int n;
int a;

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

		b = new int[n / 4];
		int res = 0;

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

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

using namespace std;

int main() {
	int n, num, sum;

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

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

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

int main()
{
    int n;
    while(cin >> n && n)
    {
        int ans = 0, t;
        n /= 4;
        REP(n){cin >> t; ans += t;}
        cout << ans << endl;

    }

    return 0;
}

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

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){
			break;
		}
		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);
	}
	for(int i=0;i<b-1;++i){
		std::cout<<e[i]<<std::endl;
	}
}

C++: #include<stdio.h>
int n,a,i;
int main(){
	n=i=a=0;for(;a=0,scanf("%d",&n),n;printf("%d\n",a))
		for(i=n/4;i--;a+=n)scanf("%d",&n);
}

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

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

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

C++: #include <bits/stdc++.h>
using namespace std;

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

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 <bits/stdc++.h>
using namespace std;

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

C++: #include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>

using namespace std;

int main() {
	int n,temp,sum;
	
	while(scanf("%d",&n))
	{
		if(n==0)
		break;
		sum = 0;
		for(int i=0;i<n/4;i++)
		{
			scanf("%d",&temp);
			sum+=temp;
		}
		printf("%d\n",sum);
	}
}