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>
using namespace std;
int main(){
	int n;
	while(cin>>n){
		if(n==0) break;
		vector<int> v;
		for(int i=0,in;i<n/4;++i){
			cin>>in;
			v.push_back(in);
		}
		int sum=0;
		for(vector<int>::iterator it=v.begin();it<v.end();++it){
			sum+=*it;
		}
		cout<<sum<<"\n";
	}
}

C++: #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string.h>
#include<math.h>
#include<cstring>
using namespace std;
#define N 501

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

C++: #include <cstdio>
#include <cstring>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>

#define rep(i, j) FOR(i, 0, j)
#define FOR(i, j, k) for(int i = j; i < k; ++i)

using namespace std;

int main(){
  int n;
  while(scanf("%d", &n) && n){
    int c = n / 4, res = 0, hit;
    while(c--){ 
      scanf("%d", &hit);
      res += hit;
    }
    printf("%d\n", res);
  }
  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<queue>
#include<stack>
#include<cmath>
#include<string.h>

using namespace std;

const int mod = 1000000007;

int main(){
    int n;
    while(cin>>n,n){
        int a,b;
        while(n--){
            cin>>a;
            b+=a;
        }
        cout<<b<<endl;
        
    }
}

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

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

C++: #include <stdio.h>

int main(void){
	int s, n, i, x;
	while(1){
		scanf("%d",&n);
		s = 0;
		for(i = 0;i < n / 4;i++){
			scanf("%d",&x);
			s += x;
		}
		printf("%d\n",s);
	}
	return 0;
}

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

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

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

int main() {
	int n;
	while(true) {
		cin >> n;
		if (n == 0) {
			break;
		}
		int sum = 0, cur;
		for (int i = 0; i < n/4; i++) {
			cin >> cur;
			sum += cur;
		}
		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;
		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<iostream>
#include<vector>
int main(){
std::vector<int> vec;
while(1){
int n;
int sum=0;
std::cin>>n;
if(n==0) break;
int a[n/4];
for(int i=0;i<n/4;i++){
std::cin>>a[i];
sum+=a[i];
}
vec.push_back(sum);
}
for(int i;i<vec.size();i++){
std::cout<<vec[i]<<std::endl;
}
}

C++: #include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int n, sum, tmp;
	
	while(1){
		cin >> n;
		if(n == 0){
			break;
		}
		
		n /= 4;
		sum = 0;
		for(int i = 0; i < n; i++){
			cin >> tmp;
			sum += tmp;
		}
		cout << sum << endl;
	}
	
	return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #include<iostream>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<cstdlib>
using namespace std;
#define REP(i,a,n) for(int i = a ; i < n ; i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;

void solve(){
}

int main(){
  int n;

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

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

int main()
{
  int n;

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

C++: #include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<queue>
#include<stack>
#include<cmath>
#include<string.h>

using namespace std;

const int mod = 1000000007;

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

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

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

C++: #include <iostream>

using namespace std;

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

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

C++: 
import java.util.Scanner;
import java.util.ArrayList;
import java.util.Stack;


class Main{
	public static void main(String[] args){
		Solve s = new Solve();
		s.solve();
	}	
}

class Solve{
	Solve(){}
	

	void solve(){
		Scanner in = new Scanner(System.in);

		while(in.hasNext()) {
			int n = in.nextInt() / 4;
			if (n == 0) return;
			int sum = 0;
			for(int i = 0; i < n; i++){
				int t = in.nextInt();
				sum += t;
			}
			System.out.println(sum);
		}
		
	}
}

C++: #include <stdio.h>

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

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