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 <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <limits>
#include <fstream>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a,b,c,d,e,f;
  cin>>a>>b>>c>>d>>e>>f;
  cout<<a+b+c+d-min(a,min(b,min(c,d)))+max(e,f)<<endl;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <math.h>
#include <bitset>
#define INF 2000000000
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
#define ll long long
#define PL pair<long long, long long>
#define P pair<int,int>
#define mk make_pair
#define en endl;
#define WHITE 0
#define BLACK 2
#define GRAY 1
#define RE return 0;
#define HERE cout<<"    "<<"HERE"<<en

int main(){
  int a,b,c,d,e,h;
  cin>>a>>b>>c>>d>>e>>h;
  int sum=a+b+c+d+e;
  
  int f=min(a,b);
  f=min(f,c);
  f=min(f,d);
  
  int g=min(h,e);
  
  cout<<sum-g-f<<en
}

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

#define ARG4(_1, _2, _3, _4, ...) _4
#define rep(...) ARG4(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define REP(i, a) FOR(i, 0, a)
#define FOR(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define rrep(...) ARG4(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
#define RREP(i, a) RFOR(i, 0, a)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (int)(a); --i)
#define ALL(c) (c).begin(), (c).end()
#define TEN(n) ((ll)(1e##n))
#define pb emplace_back
#define mp make_pair
#define fi first
#define se second
#define let const auto
#define USE_T template <typename T>
#define USE_Ti template <typename T = int>
#define USE_TU template <typename T, typename U>

USE_Ti using duo = std::pair<T, T>;
USE_Ti using vec = std::vector<T>;
using ll = long long;
// clang-format off
USE_TU inline bool chmax(T&x,U a){return x<a&&(x=a,1);}
USE_TU inline bool chmin(T&x,U a){return a<x&&(x=a,1);}
USE_Ti inline T in(){T x;std::cin>>x;return x;}
USE_Ti inline vec<T> in(int n){vec<T> v;v.reserve(n);rep(i,n)v.pb(in<T>());return v;}
USE_T inline void in(T*x,int n){rep(i,n)x[i]=in<T>();}
struct IoSetup {
  IoSetup(){
    using namespace std;
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout<<setprecision(10);
    cerr<<setprecision(10);
  }
} iosetup;
// clang-format on
// }}}
using namespace std;
const int inf = 1001001001;
const ll infll = 1001001001001001001ll;
const int dd[] = {0, 1, 0, -1, 0};

signed main() {
  auto S = in(6);
  int tot = std::accumulate(ALL(S), 0);
  tot -= *min_element(ALL(S) - 2);
  tot -= *min_element(4 + ALL(S));
  cout << tot << endl;
  return 0;
}

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

int main() {
  vector<int> s1;
  vector<int> s2;

  int S1, S2;

  for(int i; i < 4; i++) {
    cin >> S1;
    s1.push_back(S1);
  }

  for(int i; i < 2; i++) {
    cin >> S2;
    s2.push_back(S2);
  }

  sort(s1.begin(), s1.end(), greater<int>());
  sort(s2.begin(), s2.end(), greater<int>());

  int sum	= 0;
  for(int i = 0; i < 3; i++) {
    sum += s1[i];
  }
  for(int i = 0; i < 1; i++) {
    sum += s2[i];
  }

  cout << sum << endl;

  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a[3],e,f,x,y,z,i;
	cin>>a[0]>>a[1]>>a[2]>>a[3]>>e>>f;
	x=100;
	y=0;
	for(i=0;i<4;i++){
		y=y+a[i];
		if(x>a[i]){
			x=a[i];
		}
	}
	z=y-x;
	if(e>f){
		z=z+e;
	}else{
		z=z+f;
	}
	cout<<z<<endl;
	return 0;
}

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

int main(){
	int ad[4],ef[2];
	for(int i=0;i<4;i++)cin>>ad[i];
	for(int i=0;i<2;i++)cin>>ef[i];
	sort(ad,ad+4);
	sort(ef,ef+2);
	cout<<ad[1]+ad[2]+ad[3]+ef[1]<<endl;
	return 0;
}

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

int min(int r, int l) {
    if (r>l) return l;
    else return r;
}

int main() {
    int A, B, C, D, E, F;
    cin >> A >> B >> C >> D >> E >> F;
    cout << A+B+C+D+E+F-min(min(A,B),min(C,D))-min(E,F) << endl;
    return 0;
}

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

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

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

int main()
{
	int sum = 0, a = 100, b = 100;
	for (int i = 0; i < 4; i++) {
		int tmp;
		cin >> tmp;
		a = min(a, tmp);
		sum += tmp;
	}
	for (int i = 0; i < 2; i++) {
		int tmp;
		cin >> tmp;
		b = min(b, tmp);
		sum += tmp;
	}
	cout << sum - a - b << endl;
	return 0;
}

C++: #include<cstdio>
#include<algorithm>
using namespace std;
int main(void)
{
	int a,b,c,d,e,f,sum,mn1,mn2;
	mn1=999;
	scanf("%d",&a);
	mn1=min(mn1,a);
	scanf("%d",&b);
	mn1=min(mn1,b);	
	scanf("%d",&c);
	mn1=min(mn1,c);
	scanf("%d",&d);
	mn1=min(mn1,d);
	mn2=999;
	scanf("%d",&e);
	mn2=min(mn2,e);
	scanf("%d",&f);
	mn2=min(mn2,f);
	sum=a+b+c+d+e+f-mn1-mn2;
	printf("%d\n",sum);
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
const double EPS = 1e-10;

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

C++: #include <iostream>
#include <algorithm>
#include <numeric>
 
using namespace std;
 
int main(){
    int a[4], b[2];
    for(auto&& i : a){
        cin >> i;
    }
    for(auto&& j : b){
        cin >> j;
    }
    sort(rbegin(a), rend(a));
    sort(rbegin(b), rend(b));
    cout << accumulate(begin(a), begin(a) + 3, 0) + b[0] << "\n"; 
}