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 <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <stack>
#include <numeric>
#include <algorithm>
#include <tuple>
#include <stdio.h>
#include <bitset>
#include <limits.h>
#include <complex>
#include <deque>
#include <iomanip>
#include <list>
#include <cstring>
using namespace std;
#define pi pair<int,int>
#define pl pair<long long,long long>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define en cout << endl //セミコロンつけろ
//#define MM 1000000000
//#define MOD MM+7
typedef long long ll;
const int MM = 1e9;
const int MOD = MM+7;
const long double PI = acos(-1);
const long long INF = 1e15;
int dx[8] = {-1,0,1,0,-1,-1,1,1};
int dy[8] = {0,-1,0,1,-1,1,1,-1};
// 'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122
template<typename T>
T GCD(T u,T v){
    return v ? GCD(v,u%v) : u;
}
template<typename T>
T LCM(T x,T y){
    T gc = GCD(x,y);
    return x*y/gc;
}
struct edge {
    ll to,cost;
};
/*
const int COM_MAX = 500500;
long long fac[COM_MAX],finv[COM_MAX],inv[COM_MAX];
void init(){
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(int i = 2; i < COM_MAX; i++){
        fac[i] = fac[i-1]*i%MOD;
        inv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD;
        finv[i] = finv[i-1]*inv[i]%MOD;
    }
}
long long COM(int n,int k){
    if(n < k || n < 0 || k < 0) return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}
*/
int main(){
    while(true){
        int N; cin >> N;
        if (N == 0){
            break;
        }
        int sum = 0;
        for (int i = 0; i < N/4; i++){
            int a; cin >> a;
            sum += a;
        }
        cout << sum << endl;
    }

}

C++: #include<iostream>
using namespace std;
int main(){
  int n,point,ans;
  while(1){
    cin >> n;
    if(n==0){
      break;
    }
    ans=0;

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

C++: #include <iostream>
#include <sstream>
#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>
using namespace std;

int main()
{
    for(;;){
        int n;
        cin >> n;
        if(n == 0)
            return 0;
        int ret = 0;
        for(int i=0; i<n/4; ++i){
            int tmp;
            cin >> tmp;
            ret += tmp;
        }
        cout << ret << endl;
    }
}

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

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

C++: #include<iostream>
#include<vector>
int main() {
	int i = 0;
	int n;
	int a = 0;
	std::cin >> n;
	std::vector<int>v(n/4);
	while (std::cin >> v[i]&&++i) {
		if (v[i] == 0) {
			break;
		}
		a += v[i];
	}
	std::cout << i << std::endl;
	return 0;
}

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 <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>

////////////////*My library*////////////////////////
#define rep_to(a,i,n) for(i=a;i<n;i++)
#define rep(i,n) for(i=0;i<n;i++)
#define rep_r(i,n) for(i=n-1;i>=0;i--)
#define debug_i(x) printf("x:%d\n",x)
#define debug_f(x) printf("x:%f\n",x)
#define debug_s(str) printf("str:%s\n",str)
#define debug_c(c) printf("c:%c\n",c)
#define s_i1(x) scanf("%d",&x)
#define s_i2(x,y) scanf("%d %d",&x,&y)
#define s_i3(x,y,z) scanf("%d %d %d",&x,&y,&z)
////////////////////////////////////////////////////

////////////////////////
/*prime()*/
/*primecount()*/
/*sort()*/
///////////////////////

int main()
{
	int N,i,num,ans=0;
	while(1)
	{
		s_i1(N);
		if(N==0)break;
		ans=0;
		rep(i,N/4)
		{
			s_i1(num);
			ans+=num;
		}
		printf("%d\n", ans);
	}
	return 0;
}

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

int main(){
	int n;
	while(cin>>n)
		{	if(n!=0){
			int s=0;
			int k;
			for(int i=0;i<n/4;i++){
				cin>>k;
				s+=k;
			}
			cout<<s<<endl;
		}
			else
				break;
		}
}

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

int main(void){
  int n;
  while(1){
    int points = 0;
    std::cin >> n;
    if(n == 0)  return 0;
    for(int i=0; i < n/4; i++){
      int tmp; std::cin >> tmp;
      points += tmp;
    }
    std::cout << points << std::endl;
  }
}

C++: while True:
	n = int(raw_input())
	if n == 0: break
	print sum(int(raw_input()) for i in xrange(n / 4))

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype
template <class T> int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define popcount __builtin_popcount
           
#define rep(i, n) for (int i = 0; i < n; ++i)

template <class T> void max_swap(T& a, const T& b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T& b) { a = min(a, b); }

const double EPS = 1e-10;
typedef long long ll;
typedef pair<int, int> pint;


int main()
{
    int n;
    while (scanf("%d", &n), n)
    {
	n /= 4;
	int res = 0;
	rep (i, n)
	{
	    int t;
	    scanf("%d", &t);
	    res += t;
	}
	printf("%d\n", res);
    }
}

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

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

using namespace std;

int main() {

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