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>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define MOD 1000000007
#define EPS 1e-10
#define MAX_N 100100
#define MAX_M 100100

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;
typedef pair<int, string> PSI;

int a[10], b[10];

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

C++: #include <iostream>

#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

int A[6];
int main() {
    rep(i, 6) cin >> A[i];
    sort(A, A + 4);
    sort(A + 4, A + 6);
    int ans = 0;
    rep(i, 3) ans += A[i + 1];
    ans += A[5];
    cout << ans << endl;
    return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int a,sum=0,c,d,min=101;
    for(int i=0;i<4;i++){
        cin>>a;
        sum+=a;
        if(min>a)min=a;
    }
    sum-=min;
    cin>>c>>d;
    if(c>d)cout<<sum+c<<endl;
    else cout<<sum+d<<endl;
}

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

using namespace std;

int main() {
    int sum = 0;
    int mini = 101;
    for (int i = 0; i < 4; ++i) {
        int s;
        cin >> s;
        sum += s;
        mini = min(s, mini);
    }
    int s1, s2;
    cin >> s1 >> s2;
    cout << sum - mini + max(s1, s2) << '\n';
}

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

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;

template<class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;

int main() {
    int a, b, c, d, e, f;
    scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f);
    cout << a+b+c+d+e+f-min({a, b, c, d})-min({e, f}) << "\n";
    return 0;
}

C++: //JOI2015 1 Selecting Subjects
//20181209
//F_Naru
#include<iostream>
#include<algorithm>
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(void)
{
	int a[7], ruio=0, hideo=0,masatoy=0,i,j;
	for ( i = 1; i <= 6; i++){
		scanf("%d", &a[i]);
	}
	for (i = 1; i < 4; i++) {
		for (j = 4; j > i; j--) {
			if (a[j] > a[j - 1]) {
				ruio = a[j];
				a[j] = a[j - 1];
				a[j - 1] = ruio;

			}
		}
	}
	if (a[5] < a[6]) {
		a[5] = a[6];
	}
	printf("%d\n", a[1] + a[2] + a[3] + a[5]);
	return 0;
}

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

int main(){
	int s[4];
	int m_max;
	int h[2];
	int h_max;
	for(int i = 0;i<4;i++){
		cin>>s[i];
		m_max += s[i];
	}
	m_max -= (min(s[0],min(s[1],min(s[2],s[3]))));
	for(int i = 0;i<2;i++){
		cin>>h[i];
		h_max+=h[i];
	}
	h_max -= (min(h[0],h[1]));
	m_max += h_max;
	cout<<m_max<<endl;
}

C++: #include <iostream>
#include <cmath>

using namespace std;

int main() {
	int d[4];
	int e, f;
	int sum = 0;
	int MIN = 1000;
	for (int i = 0; i < 4; i++) {
		cin >> d[i];
		sum += d[i];
		MIN = min(MIN, d[i]);
	}
	cin >> e >> f;
	sum += max(e, f);
	cout << sum-MIN << endl;
	return 0;
}

C++: #include <bits/stdc++.h>
#define int long long
#define ALL(c) begin(c),end(c)
using namespace std;
signed main() {
    vector<int> a(4),b(2);
    for(int i=0; i<4; i++) cin>>a[i];
    for(int i=0; i<2; i++) cin>>b[i];
    sort(ALL(a));
    sort(ALL(b));
    cout<<(accumulate(ALL(a),0ll)-a[0])+(accumulate(ALL(b),0ll)-b[0])<<endl;
    return 0;
}

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

int main() {
  int a, b, c, d, e, f, x, y;
  cin >> a >> b >> c >> d >> e >> f;
  
  if (a > b) {
    x = a;
    a = b;
    b = x;
  }
  if (b > c) {
    x = b;
    b = c;
    c = x;
  }
  if (c > d) {
    x = c;
    c = d;
    d = x;
  }
  if (b > c) {
    x = b;
    b = c;
    c = x;
  }
  if (a > b) {
    x = a;
    a = b;
    b = x;
  }
  if (e > f) {
    y = e;
    e = f;
    f = y;
  }
  cout << b + c + d + f << endl;
  
  return 0;
  
}

C++: #include <stdio.h>
#include <algorithm>
#include <array>

using namespace std;

#define loop(index, begin, end, step) for (index = begin; i < end; i += step)
#define lp(index, end) loop(index, 0, end, 1)

int main()
{
	int i, sum = 0;
	array<int, 10> a, b;

	lp(i, 4)
		scanf("%d", &a[i]);
	lp(i, 2)
		scanf("%d", &b[i]);

	sort(a.rbegin(), a.rend());
	sum = max(b[0], b[1]);
	lp(i, 3)
	{
		sum += a[i];
	}

	printf("%d", sum);
	return 0;
}

C++: //============================================================================
// Name        : AOL.cpp
// Author      : Akari Fujii
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;

int main() {
int a,b,c,d,e,f,g,s;
cin>>a>>b>>c>>d>>e>>f;
    g=a+b+c;
    if( a,b,d>c)g=a+b+d;
    if( a,c,d>b)g=a+c+d;
    if( b,c,d>a)g=b+c+d;
    s=e;
    if( e<f)s=f;
    cout<<g+s<<endl;
}

C++: #include<stdio.h>
int main(void)
{
	int a[10],i,m;
	m=0;
	for(i=0;i<6;i++){
		scanf("%d",&a[i]);
		m=m+a[i];
	}
	printf("%d\n",m);
	return 0;
}

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

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

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

	if(a<b){swap(a,b);}
	if(b<c){swap(b,c);}
	if(c<d){swap(c,d);}
	if(a<d){swap(a,d);}

	if(e<f){swap(e,f);}

	cout<<a+b+c+e<<endl;



return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
#include<stdio.h>
#include <cstdint>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const ll mod = 1e9 + 7;


int a[4], b[2], total;

int main(){

	rep(i, 4)cin >> a[i];
	rep(i, 2)cin >> b[i];

	sort(a, a + 4);
	sort(b, b + 2);
	total = a[1] + a[2] + a[3] + b[1];

	cout << total << endl;

	return 0;
}