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)
	}
}

Python: while True:
    a = input()
    n = int(a)
    if n == 0:
        break
    ans = 0
    for i in range(n//4):
        ans += int(input())
    print(ans)

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

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

  return 0;
}

C++: #include <iostream>

using namespace std;

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

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

using namespace std;

int main(){

  int n;

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

}

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

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

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/4 << std::endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin(); it!=(c).end(); it++)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define pr(a) cout << (a) << endl
typedef long long ll;
typedef pair<int,int> P;
const int MAX=1000000000;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

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;
    }
    pr(sum);
  }
  return 0;
}

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

int main()
{
  int n;
  int sum = 0;

  while (scanf("%d", &n), n){
    for (int i = 0; i < n / 4; i++){
      int ac;
      scanf("%d", &ac);
      sum += ac;
    }
    printf("%d\n", sum);
  }
  return (0);
}

C++: #include <iostream>

using namespace std;

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

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<iomanip>
#include<set>
#include<queue>

using namespace std;

int main()
{
	int n;
	while(cin>>n and n!=0)
	{
		int cnt=0;
		for(int i=0;i<n/4;i++)
		{
			int a;
			cin >> a;
			cnt+=a;
		}
		cout << cnt << endl;
	}
}

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<iostream>
using namespace std;
int l,h,a;
int main(){
  for(;l>0;cin>>l){
    h=0;
    for(;l>0;l=l-4){
      cin>>a;
      h+=a;
    }
    cout<<h<<endl;
  }
}

C++: #include <iostream>

using namespace std;

void solve()
{
	int N;
	while(cin >> N, N)
	{
		int sum = 0;
		int n = N / 4;
		int temp;
		for(int i = 0; i < n; ++i)
		{
			cin >> temp;
			sum += temp;
		}
		cout << sum << endl;
	}
}

int main()
{
	solve();
	return(0);
}

C++: # include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
constexpr int MOD = 1000000007;
constexpr int INF = 2000000000;
using namespace std;


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

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

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

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cstdlib>

int n;

int main(){
    while (true) {
        int ans = 0;
        std::cin >> n;
        if(n == 0)
            break;
        n /= 4;

        for(int i = 0; i < n; ++i){
            int in;
            std::cin >> in;
            ans += in;
        }

        std::cout << ans << std::endl;
    }
    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<bits/stdc++.h>

using namespace std;

int main(){

  int n;

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

}

C++: #include<stdio.h>


int main(){
	int n;
	int count;
	int i,c;
	scanf("%d",&n);

	while(n!=0){
		i=c=count=0;
		for(i=0;i<n/4;i++){
			scanf("%d",&c);
			count=count+c;
		}
		printf("%d\n",count);

		scanf("%d",&n);
	}
}