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>

int main(int argc, char *argv[]) {
	int sum;
	while (true) {
		fscanf(stdin, "%d", &sum);
		if (sum==0) break;
		int tmp, hits=0;
		for (int i = 0; i < sum/4; i++) {
			scanf("%d", &tmp);
			hits+=tmp;
		}
		printf("%d\n", hits);
	}
	return 0;
}

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

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

    n /= 4;
    int result = 0;
    for (int i = 0,buf = 0; i < n; ++i)
    {
      cin >> buf;
      result += buf;
    }
    cout << result << endl;
  }
  return 0;
}

C++: #include<stdio.h>
int main(){
	int a;
	while(scanf("%d",&a),a){
		int ret=0;
		for(int i=0;i<a/4;i++){
			int b;
			scanf("%d",&b);
			ret+=b;
		}
		printf("%d\n",ret);
	}
}

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


int main(void)
{
	int n = 0;
	int ans = 0;
	int input = 0;

	while (scanf("%d" , &n) && n != 0)
	{
		ans = 0;
		for (int i = 0; i < n / 4; i++)
		{
			cin >> input;
			ans += input;
		}

		cout << ans << endl;
	}

	return 0;
}

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

int main(){
	int n,i,hit,total;

	while(cin>>n,n){
		hit=total=0;
		for(i=0;i<(n/4);i++){
			cin>>hit;
			total+=hit;
		}
		cout<<total<<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 <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>
using namespace std;
int main(){
	int n;
	while(cin >> n,n){
		int sum = 0,a;
		for(int i = 0; i < n; i+=4){
			cin >> a;
			sum += a;
		}
		cout << sum << 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;
			if (b == 0) {
				break;
			}
			a += b;
		}
		v.push_back(a);
}
	for (int i = 0; i < v.size(); ++i) {
		std::cout << v[i]<< std::endl;
	}
	return 0;
}

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

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

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

int main(){
    int n;
    int result;
    int tmp;

    while(cin >> n, n!=0){
        result = 0;
        n /= 4;
        for(int i=1; i<=n; i++){
            cin >> tmp;
            result += tmp;
        }
        cout << result << endl;
    }

    return 0;
}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <algorithm>
#include <cassert>

using namespace std;


bool solve(){
	while(1){
		int n;
		cin>> n;
		if(!n) break;
		int ans=0;
		for(int i=0;i<n/4;i++){
			int in;
			cin>> in;
			ans += in;
		}
		cout<< ans<< endl;
	}

	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	solve();

	return 0;
}

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

int main(){
  int n;
  int tmp;
  int score;

  while(1){
    cin >> n;
    if(!n)break;

    score = 0;
    n /= 4;
    for(int i=0;i<n;i++){
      cin >> tmp;
      score += tmp;
    }

    cout << score << endl;
  }
  return 0;
}

C++: #include<cstdio>
using namespace std;
main(){
  int n;
  while(1){
    scanf("%d",&n);
    if(!n) break;
    int sum=0;
    for(int i=0;i<n/4;i++){
      int a;
      scanf("%d",&a);
      sum+=a;
    }
    printf("%d\n",sum);
  }
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<iomanip>
using namespace std;
#define pi 3.141592653589793283462
int main(){
	int m,n,p;
	p=0;
	while (1)
	{
		cin>>n;
		if(n==0)
			break;
		for(int i=0;i<n/4;i++){
			cin>>m;
			p+=m;
		}
		cout<<p<<endl;
	}
	return 0;
}

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

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

C++: #include<iostream>
#include<vector>
using namespace std;
int main() {
	vector<int> n;
	while (true){
		int a, ya, b;
		cin >> a;
		if (a == 0) {
			break;
		}
		for (int i = 0; i < a / 4; ++i) {
			cin >> b;
			ya += b;
		}
		n.push_back(ya);
	}
	for (int i = 0; i < n.size(); ++i) {
		cout << n[i] << endl;
	}
	//system("pause");
	return 0;
}

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

C++: #include<iostream>

using namespace std;

int main(){

  int n;
  int tekityu;
  int total[100]={0};
  int count=0;  

  while(cin>>n,n){
    
    for(int i=0;i<n/4;i++){
      cin>>tekityu;
      total[count]+=tekityu;
    }
    
    count++;

  }
  
  for(int i=0;i<count;i++)
    cout<<total[i]<<endl;

  return 0;

}

C++: #include <iostream>

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

C++: #include <iostream>

using namespace std;

int main(void){

  int n;
  while( cin >> n , n ){
    n /= 4;
    int total = 0;
    int in;
    while(n--){
      cin >> in;
      total += in;
    }
    cout << total << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <math.h>
#include <string>
#include <stack>
#include <set>
#include <vector>
using namespace std;
typedef long long ll;

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