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++: // ?????±???????????????????????? 2015-1
#include<cstdio>
#include<algorithm>
using namespace std;
 
 
int main(){
  int a[4],b[2];
  for(int i=0;i<4;i++) scanf("%d",a+i);
  for(int i=0;i<2;i++) scanf("%d",b+i);
  sort(a,a+4);
  sort(b,b+2);
  int ans = 0;
  for(int i=3;i>0;i--) ans+=a[i];
  ans+=b[1];
  printf("%d\n",ans);
  return 0;
}

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

int main()
{
  int n[4], a, b;

  for (int i = 0; i < 4; i++){
    cin >> n[i];
  }

  cin >> a >> b;
  sort (n, n + 4);
  int res = 0;
  for (int i = 0; i < 3; i++){
    res += n[3 - i];
  }
  cout << res + max(a, b) << endl;
}

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

using namespace std;

int main() {
    int a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;

    int ans = a + b + c + d - min({a, b, c, d}) + max(e, f);
    cout << ans << endl;
    return 0;
}

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

int max( int a, int b )
{
    if( a > b )
        return a;
    else
        return b;
}

int min( int a, int b )
{
    if( a < b )
        return a;
    else
        return b;
}

int main()
{
    int score[6];

    for( int i = 0; i < 6; i++ )
        cin >> score[i];
    
    int sum = 0;
    sum += max( score[0], score[1] );
    sum += max( score[2], score[3] );
    sum += max( min( score[0], score[1] ), min( score[2], score[3] ) );
    sum += max( score[4], score[5] );

    cout << sum << endl;

    return 0;
}

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

int main() {
	int rika[4], shakai[2], min, sum=0;
	for(int i=0; i<4; i++) cin >> rika[i];
	min = sum = rika[0];
	for(int j=0; j<2; j++) cin >> shakai[j];
	for(int k=1; k<4; k++){
		if(min>rika[k]) 
		min = rika[k];
		sum += rika[k];
	}
	sum -= min;
	if(shakai[0]>=shakai[1]) sum += shakai[0];
	else sum += shakai[1];
	cout << sum << endl;
	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,aka;
cin>>a>>b>>c>>d>>e>>f;
    g=a+b+c+d;
    aka=a;
    if( a>b)aka=b;
    if( b>c)aka=c;
    if( c>b)aka=d;
    g=g-aka;
    s=e;
    if( e<f)s=f;
    cout<<g+s<<endl;
}

C++: #include "bits/stdc++.h"

using namespace std;

const char en = '\n';
using  ll =          long long;
using ull = unsigned long long;
#define REP(i  ,n) for(int i=0;i<n;i++)
#define FOR(i,s,g) for(int i=s;i<g;i++)
const ll INFL = 810810191911451400;
const int INF =       1919114514;

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

	int sum=0,buf,MIN=INF;
	REP(i, 4){
		cin>>buf;
		sum+=buf;
		MIN=min(buf,MIN);
	}
	sum-=MIN;

	cin>>buf>>MIN;

	sum+=max(buf,MIN);

	cout<<sum<<en;
	return 0;
}

C++: /* template.cpp [[[ */
#include <bits/stdc++.h>
using namespace std;
#define get_macro(a, b, c, d, name, ...) name
#define rep(...) get_macro(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define rrep(...) get_macro(__VA_ARGS__, rrep4, rrep3, rrep2, rrep1)(__VA_ARGS__)
#define rep1(n) rep2(i_, n)
#define rep2(i, n) rep3(i, 0, n)
#define rep3(i, a, b) rep4(i, a, b, 1)
#define rep4(i, a, b, s) for (ll i = (a); i < (ll)(b); i += (ll)s)
#define rrep1(n) rrep2(i_, n)
#define rrep2(i, n) rrep3(i, 0, n)
#define rrep3(i, a, b) rrep4(i, a, b, 1)
#define rrep4(i, a, b, s) for (ll i = (ll)(b) - 1; i >= (ll)(a); i -= (ll)s)
#define each(x, c) for (auto &&x : c)
#define fs first
#define sc second
#define all(c) begin(c), end(c)
using ui = unsigned;
using ll = long long;
using ul = unsigned long long;
using ld = long double;
const int INF = 1e9 + 10;
const ll INF_LL = 1e18 + 10;
const int dx[]{-1, 0, 1, 0, -1, 1, 1, -1};
const int dy[]{0, -1, 0, 1, -1, -1, 1, 1};
template<class T, class U> void chmin(T &x, const U &y){ x = min<T>(x, y); }
template<class T, class U> void chmax(T &x, const U &y){ x = max<T>(x, y); }
/* ]]] */

int main(){
  int a, b, c, d, e, f;
  cin >> a >> b >> c >> d >> e >> f;
  cout << a + b + c + d - min({a, b, c, d}) + max(e, f) << endl;
}

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

int main() {
    int A,B,C,D,E,F,x,y,z;
    cin >> A >> B >> C >> D >> E >> F;
 if(A>B) {
 x=B;
}
 else {
 x=A;
}
 if(x>C){
 x=C;
}
 if(x>D){
 x=D;
}
z=A+B+C+D-x;
if(E>F) {
	y=E;
}
	else {
		y=F;
}
cout << z+y << 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\n", sum);
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
  int sm = 0;
  int mn = 100;
  int ans = 0;
  for(int i = 0;4 > i; i++){
    int tmp;cin>>tmp;
    sm += tmp;
    mn = min(mn,tmp);
  }
  ans = sm-mn;
  sm = 0;
  mn = 100;
  for(int i = 0; 2 > i; i++){
    int tmp;cin>>tmp;
    sm += tmp;
    mn = min(mn,tmp);
  }
  cout << ans+sm-mn << endl;
}

C++: #include<stdio.h>
int main(void)
{
	int a,b,c,d,e,f,g,h,i,j,x;
	scanf("%d %d %d %d %d %d",&a,&b,&c,&e,&f);
	if(a>b){
		a=g;
	}
	else if(a<b){
		b=g;
	}
	if(b>c){
		b=h;
	}
	else if(b<c){
		c=h;
	}
	if(c>d){
		c=i;
	}
	else if(c<d){
		d=i;
	}
	if(e>f){
		e=j;
	}
	else if(e<f){
		f=j;
	}
	x=g+h+i+j;
	printf("%d\n",x);
	return 0;
}

C++: #include <cstdio>
#include <algorithm>

int main() {

	int a[6];
	int i;
	int ans = 0;

	for (i = 0; i < 4; ++i) scanf("%d",&a[i]);

	std::sort(a, a + 4);
	ans += a[3] + a[2] + a[1];

	scanf("%d%d", &a[4], &a[5]);
	a[4] >= a[5] ? ans += a[4] : ans += a[5];

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

C++: #include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
int main(){
	int A, B, C, D, E, F;
	scanf("%d%d%d%d%d%d", &A, &B, &C, &D, &E, &F);
	printf("%d\n", A + B + C + D + E + F - min(min(A, B), min(C, D)) - min(E, F));
	return 0;
}

C++: // helloworld.cpp : アプリケーションのエントリ ポイントを定義します。
//
/*#include "stdafx.h"*/
//
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <cmath>
#include <string>
#include <cstring>
#include <iterator>
#define FI first
#define SE second
#define PF push_front
#define PB push_back
#define POF pop_front
#define POB pop_back
#define MA make_pair
#define ll long long
#define VE vector<int>
#define VP vector<pair<int,int> >
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
using namespace std;
//
const int INF = 1e9 + 7;
const int mod = 1e9 + 7;
//
int main() {
    int A, B, C, D, E, F;
    cin >> A >> B >> C >> D >> E >> F;
    int S = A + B + C + D + E + F;
    cout << S - min(E, F) - min(A, min(B, min(C, D))) << endl;
    return 0;
}