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 <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>

using namespace std;
#define loop(i,a,b) for(int i=(a);i<int(b);i++)
#define rep(i,b) loop(i,0,b)

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

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
using namespace std;
typedef pair<int, int> pii;
#define MAX 99999999
int main(){
    int n;
    while(cin>>n,n){
        int sum=0;
        rep(i,n/4){int temp;cin>>temp;sum+=temp;}
        cout<<sum<<endl;
    }
}

C++: #include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

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

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

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

C++: # include <iostream>

int n;
int sum = 0;

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

C++: #include<iostream>
#define MAX_ARRAY 100

using namespace std;

int main(void){
    int tekichu[MAX_ARRAY],sum,n;

    while(cin>>n,n){
        sum=0;
        for(int i=0;i<MAX_ARRAY;i++){
            tekichu[i]=0;
        }   
        n=n/4;
        for(int i=0;i<n;i++){
            cin>>tekichu[i];
            sum=sum+tekichu[i];
        }   
        cout<<sum<<endl;
    }   
    return 0;
}

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

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

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

C++: #include <iostream>

int main() {
	int n;
	
	while (std::cin >> n, n) {
		int ans = 0;

		for (int i = 0; i < n / 4; ++i) {
			int x;
			std::cin >> x;

			ans += x;
		}

		std::cout << ans << std::endl;
	}
}

C++: #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define CLR(a) memset(a,0,sizeof(a))
#define SET(a,c) memset(a,c,sizeof(a))

#define DEBUG(x) cout<<"#x"<<": "<<x<<endl

using namespace std;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;

const ll INF = INT_MAX/3;
const ll MOD = 1000000007;
const double EPS = 1e-14;
const int dx[] = {1,0,-1,0} , dy[] = {0,1,0,-1};

int main(){
    while(true){
	int n;
	cin >> n;
	if(n==0) break;
	int ans = 0;
	REP(i,n/4){
	    int temp;
	    cin >> temp;
	    ans += temp;
	}
	cout << ans << 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>
#include <algorithm>

using namespace std;

int main(){

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

	return 0;
}

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

C++: #include<iostream>

using namespace std;

int main(void){
  int n,x;

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

C++: #include <iostream>

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

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

int main(){
    int a,n,x,i,sum=0;
    while(1){
		scanf("%d",&n);
		if(n==0)break;
		x=n/4;
		for(i=0;i<x;i++){
			cin>>a;
			sum +=a;
		}
        cout<<sum<<endl;
		sum=0;
    }
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<queue>
#include<stack>
#include<cmath>
#include<string.h>

using namespace std;

const int mod = 1000000007;

int main(){
    int n;
    while(cin>>n,n){
        int a,b;
        while(n){
            n/=4;
            cin>>a;
            b+=a;
        }
        cout<<b<<endl;
        
    }
}

C++: #include <bits/stdc++.h>
using namespace std;

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

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

  return EXIT_SUCCESS;
}

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

int main() {
	int n;
	while(scanf("%d",&n),n!=0){
		int sum=0;
		for(int i=0;i<n/4;i=i+1){
			int m;
			cin >> m;
			sum = sum + m;
		}
		cout << sum << endl;
	}
	// your code goes here
	return 0;
}