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,sum,hit;
  while(1){
  cin >> n;
  sum=0;
  if(n==0)break;
  for(int i=0;i<n/4;i++){
    cin >>hit;
    sum+=hit;

  }
cout << sum <<endl;

}
  

  return 0;
}

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

int getInt(){
  int ret = 0,c;
  c = getchar();
  while(!isdigit(c)) c = getchar();
  while(isdigit(c)){
    ret *= 10;
    ret += c - '0';
    c = getchar();
  }
  return ret;
}

using namespace std;

int main(){
  while(int n = getInt() / 4){
    int ans = 0;
    while(n --> 0) ans += getInt();
    cout << ans << endl;
  }
  return 0;
}

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 += temp;
    }
    ans.push_back(sum);
  }
  for(int i:ans){
    cout << i << endl;
  }
  return 0;
}

C++: #include<iostream>

using namespace std;

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

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

#define loop(v, f, l) for(int v = (f), v##_ = (l); v < v##_; ++v)

using namespace std;

typedef long long int lint;
static inline int in(){ int x; scanf("%d", &x); return (x); }
static inline lint inl(){ lint x; scanf("%lld", &x); return (x); }

int main()
{
	int n;
	int result;
	while( true )
	{
		n = in();
		if( n == 0 )break;
		
		result = 0;
		for(int i = 0; i < n / 4; i++)
		{
			result += in();
		}
		printf("%d\n", result);
	}
	return (0);
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

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

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 += temp;
    }
    ans.push_back(sum);
  }
  for(int i:ans){
    cout << i << endl;
  }
  return 0;
}

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

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

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

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }

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

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

int main(){
  int N=1;
  int point =0;
  int a=0;
  
  while(!(N==0)){
    point =0;
    cin >> N;
    if(N==0){
      break;
    }
    rep(i,(N/4)){
      cin >> a;
      point= point + a;
    }
    cout << point <<endl;
  } 
  return 0; 
}

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;
		}
		if (i > 4) {
			break;
		}
		a += v[i];
	}
	std::cout << a << std::endl;
	return 0;
}

C++: #include <bits/stdc++.h>
#define FOR(v, a, b) for(int v = (a); v < (b); ++v)
#define FORE(v, a, b) for(int v = (a); v <= (b); ++v)
#define REP(v, n) FOR(v, 0, n)
#define REPE(v, n) FORE(v, 0, n)
#define RS resize
#define CLR clear
#define PB push_back
#define ALL(x) (x).begin(), (x).end()
using namespace std;

void split(string str, char chr, vector< string > *res){
	stringstream ss(str);
	string itm;
	while(getline(ss, itm, chr)){
		(*res).PB(itm);
	}
}


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

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

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

C++: #include <iostream>
#include <string>
#include<fstream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void){
   while(true){
        int n;
        cin >> n;
        if(n==0)break;
        vector <int> l(n);
        int a=0;
        for(int i = 0; i < n/4; i++){
            cin >> l[i];
        }
        for(int i = 0; i < n/4; i++){
            a=l[i]+a; 
        }
    cout << a << endl;
   }
}