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 <set>
#include <algorithm>
using namespace std;

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

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

C++: #include <iostream>
#include <vector>
int main(){
	int n;
	std::vector<int> shot(0);
	int a=1;
	std::vector<int> yeah(0);
	while(true){
		yeah.resize(a);
		std::cin>>n;
		if(n==0){
			break;
		}
		for(int i=1;i<=n/4;i++){
			shot.resize(i);
			std::cin>>shot[i-1];
			yeah[a-1]+=shot[i-1];
		}
		a++;
	}
	for(int i=0;i<a-1;i++){
		std::cout<<yeah[i]<<std::endl;
	}
}

C++: #include <stdio.h>

int main(void) {

  int n;

  int hit;
  int sum;

  int i;


  while(1) {

    scanf("%d",&n);

    if(n==0) break;

    sum=0;

    for(i=0;i<n/4;i++) {

      scanf("%d",&hit);

      sum+=hit;

    }

    printf("%d\n",sum);

  }

  return 0;

}

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

using namespace std;

int main()
{
  while(1){
    int n;
    cin>>n;

    if(n == 0){
      break;
    }

    int times = n / 4;
    int ans = 0;

    for(int i = 0;i < times;++i){
      int a;
      cin>>a;
      ans += a;
    }

    cout<<ans<<endl;
  }

  return 0;
}

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

C++: #include <algorithm>
#include <bitset>
#include <cctype>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define each(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define exist(s,e) ((s).find(e)!=(s).end())
#define range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 29;

int main(void){
    for(int n, res; cin >> n, n; cout << res << endl){
        res = 0;

        rep(i, n / 4){
            int a; cin >> a;
            res += a;
        }
    }

	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){
			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);
		}
		else{
			break;
		}
	}
	for(int i=0;i<b;++i){
		if(e[i]==0){
			break;
		}
		std::cout<<e[i]<<std::endl;
	}
}

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

}

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 <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++: //Name: Kyudo: A Japanese Art of Archery
//Level: 1
//Category: やるだけ
//Note:

/**
 * 問題文の通りに処理し、合計するだけ。
 */
#include <iostream>
#include <vector>

using namespace std;

bool solve() {
    int N;
    if(!(cin >> N)) return false;
    if(!N) return false;

    int sum = 0;
    for(int i = 0; i < N/4; ++i) {
        int a;
        cin >> a;
        sum += a;
    }
    cout << sum << endl;
    return true;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);

    while(solve()) ;
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
ll factorial(ll n) {
  if (n == 1) {
    return 1;
  }
  ll ans = factorial(n-1);
  return ans*n;
}
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a%b);
}
ll lcm(ll a, ll b) {
  return (a/gcd(a, b))*b;
}
bool is_prime(ll n) {
  for (ll i = 2; i*i <= n; i++) {
    if (n%i == 0) return false;
  }
  return n != 1;
}
ll mod_pow(ll x, ll n, ll mod) {
  if (n == 0) return 1;
  ll res = mod_pow(x*x%mod, n/2, mod);
  if (n & 1) res = res * x % mod;
  return res;
}

int main() {
    ll n;
    while (cin >> n) {
        if (n == 0) {
            break;
        } else {
            ll res = 0;
            rep(i, n/4) {
                ll a;
                cin >> a;
                res += a;
            }
            cout << res << endl;
        }
    }
}

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