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, s;

	cin >> a >> b >> c >> d >> e >> f;

	s = a;

	if (s > b)
		s = b;
	if (s > c)
		s = c;
	if (s > d)
		s = d;

	if (e >= f)
		cout << a + b + c + d - s + e << endl;
	else
		cout << a + b + c + d - s + f << endl;

	return 0;
}

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+h;
  
  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 <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int a[6];
	for (int i = 0; i < 6; i++)
	{
		cin >> a[i];
	}
	sort(a, a + 4);
	sort(a + 5, a + 6);
	cout << a[1] + a[2] + a[3] + a[5] << endl;

	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int A, B, C, D, E, F; //物理、化学、生物、地学、歴史、地理
    int score[6];
    cin >> A >> B >> C >> D >> E >> F;

    score[0] = A;
    score[1] = B;
    score[2] = C;
    score[3] = D;
    score[4] = E;
    score[5] = F;

    int min1 = score[0], max2 = score[4];
    for(int i = 1; i < 4; i++){
        if(score[i] < min1) min1 = score[i];
    }
    if(score[5] > max2) max2 = score[5];

    cout << (A + B + C + D - min1 + max2) << endl;
}

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

int main(){
  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(a,a+4);
  sort(b,b+2);
  int ans=0;
  for(int i=3;i>=1;i--) ans+=a[i];
  ans+=b[1];
  cout << ans<<endl;
  return 0;
}

C++: #include <iostream>
using namespace std;
int main(void)
{
	int a,b,c[100]={0},d,e=0,f=0,g,h,i;
	for (a=0;a<4;a++)
	{
		cin>>b;
		c[b]=1;
	}
	for (a=99;a>0;a--)
	{
		if (c[b]==1&&e!=3)
		{
			f=f+b;
			e++;
		}
	}
	cin>>d>>e;
	if (d>=e)
	{
		g=d+f;
	}
	else if (d<=e)
	{
		g=e+f;
	}
	cout<<g<<endl;
	return 0;
}

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

C++: #include <stdio.h>
#define rep(i, n) for(int i = 0; i < n; ++i)

int main(void) {
  int ans = 0, n, min = 101;
  rep(i, 4) {
    scanf("%d", &n);
    ans += n;
    if(n < min) min = n;
  }
  ans -= min;
  min = 101;
  rep(i, 2) {
    scanf("%d", &n);
    ans += n;
    if(n < min) min = n;
  }
  ans -= min;
  printf("%d\n", ans);
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int a,b,c,d,e,f;
	cin>>a>>b>>c>>d>>e>>f;
	cout<<a+b+c+d+e+f-min({a,b,c,d})-min(e,f)<<endl;
}

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

int a, b, c, d, e, f;

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

C++: 
#ifdef LOCAL
  #define debug_echo(expr) cout << expr;
#else
  #define debug_echo(expr)
#endif

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

#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
using namespace std;

template<class T>
ostream& operator <<(ostream& out, const vector<T>& v) {
    out << "[";
    bool isfirst = false;
    for (const T& e : v) {
        out << (isfirst ? ", " : "") << e;
        isfirst = true;
    }
    out << "]";
    return out;
}
template<class T>
ostream& operator <<(ostream& out, const set<T>& s) {
    out << "{";
    bool isfirst = false;
    for (const T& e : s) {
        out << (isfirst ? ", " : "") << e;
        isfirst = true;
    }
    out << "}";
    return out;
}
template<class A, class B>
ostream& operator <<(ostream& out, const pair<A, B>& p) {
    out << "(" << p.first << ", " << p.second << ")";
    return out;
}
template<class K, class V>
ostream& operator <<(ostream& out, const map<K, V>& s) {
    out << "{";
    bool isfirst = false;
    for (const auto& e : s) {
        out << (isfirst ? ", " : "") << e;
        isfirst = true;
    }
    out << "}";
    return out;
}

//
// Implementation
//

vector<int> pointsA(4);
vector<int> pointsB(2);

int main() {
    rep (i, 4) {
        cin >> pointsA[i];
    }
    rep (i, 2) {
        cin >> pointsB[i];
    }
    sort(pointsA.begin(), pointsA.end());
    sort(pointsB.begin(), pointsB.end());
    cout << pointsA[3] + pointsA[2] + pointsA[1] + pointsB[1] << endl;
}