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++: //inlclude before define 
#define _USE_MATH_DEFINES

//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<type_traits>
#include<numeric>
#include<assert.h>
#include<deque>
#include<iomanip>
#include<set>
#include<tuple>
#include<map>

using namespace std;

//typedef
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef pair<int, int> P1;
typedef long long int ll;

//number
#define INF 1e9
#define NUM 1000000007

//itr
#define all(x) begin(x),end(x)

//repeat
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,a,b) for(int i=int(a);i<int(b);i++)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)

//max,min
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))

//function

/*ll gcd(ll a, ll b) {
	if (b == 0) return a;
	else return gcd(b, a%b);
}*/

/*ll lcm(ll a,ll b) {
	ll g = gcd(a, b);
	return a * (b / g);
}*/

/*int dig(int a) {
	int sum = 0;
	while (a) {
		sum += a % 10;
		a /= 10;
	}
	return sum;
}*/

//grid template
int x[] = { -1, 0, 1, 0 };
int y[] = { 0,-1,0,1 };
int xx[] = { -1,-1,1,1 };
int yy[] = { 1,-1,1,-1 };


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

		rep (i, n / 4) {
			cin >> a;
			ans += a;
		}
		cout << ans << endl;
	}

}

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

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cstdlib>

int n;

int main(){
    while (true) {
        int ans = 0;
        std::cin >> n;
        if(n == 0)
            break;
        n /= 4;

        for(int i = 0; i < n; ++i){
            int in;
            std::cin >> in;
            ans += in;
        }

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

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

int main()
{
  int n;
  while (cin >> n, n){
    int res = 0, num;
    for (int i = 0; i < n / 4 ; i++){
      cin >> num;
      res += num;
    }
    cout << res << 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 <stdio.h>
#include<math.h>
#include <algorithm>
using namespace std;

int main(){

	int n,limit,sum,tmp;
	while(true){
		scanf("%d",&n);
		if(n == 0)break;

		sum = 0;
		limit = n/4;

		for(int i=0; i < limit;i++){
			scanf("%d",&tmp);
			sum += tmp;
		}
		printf("%d\n",sum);
	}

    return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
    int n,hit;
    while(cin>>n,n){
        int sum=0;
        for(int i=0;i<n/4;i++){
                cin>>hit;
                sum+=hit;
        }
        cout<<sum<<endl;
    }
    return 0;
}

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

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

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

#define INF_LL (int64)1e18
#define INF (int64)1e9
#define REP(i, n) for(int64 i = 0; i < (n); i++)
#define FOR(i, a, b) for(int64 i = (a); i < (b); i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint32_t;
using int64 = int64_t;
using uint64 = uint64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

template<typename A, typename B> inline void chmin(A &a, B b) { if (a > b) a = b; }
template<typename A, typename B> inline void chmax(A &a, B b) { if (a < b) a = b; }

int main(void) {
  int64 n;
  while (cin >> n && n) {
    int64 sum = 0;
    REP(i, n/4) {
      int64 x;
      cin >> x;
      sum += x;
    }
    cout << sum << endl;
  }
}

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

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

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

C++: #include<iostream>

using namespace std;

int main(){

	int n;
	int hit;
	int sum;

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

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

int main()
{
    int n, a;

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

    return 0;
}

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

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

C++: import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int num;
			while ((num = Integer.parseInt(br.readLine())) != 0) {
				int total = 0;
				for (int i = 0; i < num; i = i + 4) {
					int hit = Integer.parseInt(br.readLine());
					total += hit;
				}
				System.out.println(total);
			}
		} catch (Exception e) {
			System.out.println(e);
		}
	}
}

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

int main(){
  unsigned int n,sum;
  vector<int> ans;

  while(cin >> n, n){
    sum = 0;
    for(int i=0; i<n/4; i++){
      int temp;
      cin >> temp;
      sum = sum + temp;
    }
    ans.push_back(sum);
  }
  for(int i:ans){
    cout << i << endl;
  }
  return 0;
}