Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)
	points := make([]int, 6)
	for i := 0; i < 6; i++ {
		points[i] = nextInt()
	}
	// fmt.Println(points)
	sort.Slice(points[:4], func(i, j int) bool { return points[i] > points[j] })
	// fmt.Println(points)
	points2 := points[4:]
	sort.Slice(points2, func(i, j int) bool { return points2[i] > points2[j] })
	// fmt.Println(points)

	fmt.Println(points[0] + points[1] + points[2] + points2[0])
}

C++: #include <iostream>
using namespace std;
int main(){
	int a,b,c,d,e,f;cin>>a>>b>>c>>d>>e>>f;cout<<a+b+c+d-min(min(a,b),min(c,d))+max(e,f)<<endl;
}

C++: #include <stdio.h>

int main(){
	int a[6],sum=0,min=100;
	for (int i=0;i<6;i++) scanf("%d",a+i);
	for (int i=0;i<6;i++) sum += a[i];
	for (int i=0;i<4;i++) min = (min > a[i])?(a[i]):(min);
	sum -= min;
	sum -= (a[4] < a[5])?a[4]:a[5];
	printf("%d\n",sum);
}

C++: #include <bits/stdc++.h>
using namespace std;
int a, b, c, d, e, f;
int main() {
	cin >> a >> b >> c >> d >> e >> f;
	cout << a + b + c + d + e + f - min({a, b, c, d}) - min(e, f) << endl;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <array>
#include <functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <vector>

#define INF 1000000000
#define MOD 1000000007
#define ll long long
#define rep(i,a,b) for(int i = (a); i < (b); i++)
#define bitget(a,b) (((a) >> (b)) & 1)
#define vint vector<int>
#define vvint vector<vector<int>>
#define vsort(x) sort(x.begin(),x.end())

using int64 = uint64_t;

using namespace std;
int amin(int* array, int length) {
	int ret=INF;
	rep(i, 0, length)
		ret = min(ret, array[i]);
	return ret;
}

int main() {
	int a[6];
	rep(i, 0, 6)
		cin >> a[i];
	int x, y;
	x = amin(a, 4);
	y = amin(a + 4, 2);
	int sum = 0;
	rep(i, 0, 6)
		sum += a[i];
	cout << sum - x - y << endl;
	return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
  int data[7];
  int sum=0;
  int min=100;
  int temp;  
for(int i=0;i<4;i++){
    cin >> temp;
    sum+=temp;
    if(temp<min)min=temp;
}
sum-=min;
min=100;
for(int i=0;i<2;i++){
    cin >> temp;
    sum+=temp;
    if(temp<min)min=temp;
}
sum-=min;
cout >> sum >>endl;
}

C++: #include <cassert>

#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#include <boost/foreach.hpp>
//#include <boost/range/algorithm.hpp>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define ll long long
#define Sort(v) sort(all(v))
#define INF 1000000000
#define END return 0
#define pb push_back
#define se second
#define fi first
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define MP make_pair
#define MOD 1000000007LL
using namespace std;
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};

int main (){
    int a[4],b[2];
    rep(i,0,4)cin>>a[i];
    rep(i,0,2)cin>>b[i];
    sort(a,a+4); sort(b,b+2);
    cout<<a[1]+a[2]+a[3]+max(b[0],b[1])<<endl;
}


/*
abcdea

/root
a.txt
bunp.html
/desktop
r.txt
fsharp.cs
dp.cpp
/users
bison.txt

root r.txt
users r.txt
users a.txt

desktop/r.txt
../r.txt
../../a.txt
*/

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

int main(void){
	int sci[4], soc[2];
	scanf("%d%d%d%d%d%d", sci+0, sci+1, sci+2, sci+3, soc+0, soc+1);
	sort(sci, sci+4, greater<int>());
	printf("%d\n", sci[0]+sci[1]+sci[2]+max(soc[0], soc[1]));
	return(0);
}

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

#define INF_LL 9000000000000000000
#define INF 2000000000

#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)

using namespace std;

typedef long long ll;
typedef pair<int, int> PII;

class Union_find{
private:
	vector<int> par;
	vector<int> rank;
	int n;

public:
	Union_find(int a){
		n = a;
		for(int i = 0;i < n;i++){
			par.push_back(i);
			rank.push_back(0);
		}
	}

	int find(int x){
		if(par[x] == x){
			return x;
		}else{
			return par[x] = find(par[x]);
		}
	}

	void unite(int x, int y){
		x = find(x);
		y = find(y);
		if(x == y) return;

		if(rank[x] < rank[y]){
			par[x] = y;
		}else{
			par[y] = x;
			if(rank[x] == rank[y]) rank[x]++;
		}
	}

	bool same(int x, int y){
		return find(x) == find(y);
	}
};

int main(void){
	int a[4];
	int b[2];
	int res = 0;
	REP(i, 4){
		cin >> a[i];
	}
	cin >> b[0] >> b[1];

	sort(a, a+4);
	sort(b, b+2);
	cout << a[1] + a[2] + a[3] + b[1] << endl;
	return 0;
}

C++: //2015
#include<iostream>
#include<algorithm>
#include<functional>
using namespace std;
int main(void){
	int i,ad[4]={0},e=0,f=0,sum=0;
	for(i=0;i<4;i++){
		cin>>ad[i];
	}
	cin>>e;
	cin>>f;
	sort(ad,ad+4,greater<int>());//降順,昇順＝＝sort(ad,ad+4);
	for(i=0;i<3;i++){
		sum+=ad[i];
	}
	if(e<f){
		sum+=f;
	}
	else{
		sum+=e;
	}
	cout<<sum<<endl;
	return 0;
}

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

int main(){
    int m, n;
    vector<int> a(4);
    for(int i = 0; i < 4; i++){
        cin >> a[i];
    }
    cin >> m >> n;
    sort(a.rbegin(), a.rend());
    int ans = a[0] + a[1] + a[2] + max(m,n);
    cout << ans << endl;
    return 0;
}

C++: #include<iostream>
#include<math.h>
#include<stdio.h>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<functional>

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


int main(){
	int a[4];int b[2];
	FOR(i,4){cin>>a[i];}
	FOR(i,2){cin>>b[i];}
	sort(a,a+4,greater<int>());
	sort(b,b+2,greater<int>());
	cout<<a[0]+a[1]+b[0}<<endl;
}

C++: #include<stdio.h>
#include<string.h>
int main(){
	int r=0,a[4],b[2],i,s=100,nf;
	scanf("%d%d%d%d%d%d",&a[0],&a[1],&a[2],&a[3],&b[0],&b[1]);
	for(i=0;i<4;i++){
		if(s>=a[i]){
			s=a[i];
			nf=i;
		}
	}
	for(i=0;i<4;i++){
		if(i!=nf){
			r+=a[i];
		}
	}
	if(b[0]>b[1]){
		r+=b[0];
	}else{
		r+=b[1];
	}

	printf("%d\n",r);
	return 0;
}

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

int main() {
	vector<int> V_1(4);
	for (int i = 0; i < 4; i++) {
		cin >> V_1[i];
	}
	vector<int> V_2(2);
	for (int i = 0; i < 2; i++) {
		cin >> V_2[i];
	}
	sort(V_1.begin(), V_1.end());
	sort(V_2.begin(), V_2.end());	
	cout << V_1[3] + V_1[2] + V_1[1] + V_2[1] << endl;
}