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 <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
static const double eps = 1e-5;

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

int main(void){
  int n;
  while(cin>>n){
    if(n==0) break;
    int ans=0,t;
    rep(i,n/4){
      cin>>t;
      ans+=t;
    }
    cout<<ans<<endl;
  }
  return 0;
}

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

int main(){
  int n;

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


  return 0;
}

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

C++: #include<iostream>
using namespace std;
int main(){
int n;
while(cin>>n&&n){
int t[10000];
int ans=0;
for(int i=0;i<n/4;i++)cin>>t[i],ans+=t[i];
cout<<ans<<endl;
}
return 0;
}

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

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

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

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

C++: #include <iostream>
using namespace std;
int main(){
  while(1){
  int n,k[5],ans=0;
cin>>n;
if(n==0){break;}
for(int i=0;i<n%4;++i){
cin>>k[i];
ans+=k[i];
}
cout<<ans<<endl;
}
}

C++: #include <stdio.h>

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

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 x;
      cin >> x;
      sum+=x;
    }
    cout <<sum <<endl;
  } 
}

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

using namespace std;

int n;

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

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

#define gcu getchar_unlocked
#define pcu putchar_unlocked
#define _T template <typename T>
#define _HT template <typename H, typename... T>
#define _il inline
#define _in _il int in
#define _sc _il bool scan
_T T in(int c){T n=0;bool m=false;if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0');return m?-n:n;} //&&c<='9'
_in() {return in<int>(gcu());}
_T T scan(T &n){int c=gcu();return c==EOF?false:(n=in<T>(c),true);}
_sc(char &c){c=gcu();gcu();return c!=EOF;}
#ifdef _GLIBCXX_STRING
_sc(string &s){int c;s="";
	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
#endif
_HT _sc(H &h, T&&... t){return scan(h)&&scan(t...);}
#define _vo _il void out
#define _vl _il void outl
_vo(const char *s){while(*s)pcu(*s++);}
_vo(char c){pcu(c);}
#ifdef _GLIBCXX_STRING
_vo(string s){for(char c:s)pcu(c);}
#endif
_T _vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
_vl(){out('\n');}
#ifdef _GLIBCXX_VECTOR
_T _vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);outl();}
#endif
_HT _vo(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename... T> _vl(T&&... t){out(move(t)...);outl();}

int main() {
	for (int n; (n = in());) {
		int h = 0;
		for (int i = n / 4; i; i--)
			h += in();
		outl(h);
	}
}

C++: #include <iostream>
#include <cstdio>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <sstream>
using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;

template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
	v.assign(a,vector<T>(b,t));
}

//v.erase(unique(v.begin(),v.end()),v.end());


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

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

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

	}
    return 0;
}