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<sstream>
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<cfloat>
#include<functional>
#include<map>
#include<string>
#include<cstring>
#include<vector>
#include<queue>
#include<stack>
#include<deque>
#include<set>
#include<bitset>
#include<list>
#include<numeric>
#include<complex>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<long long, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<long long, long long> ll_ll;
typedef pair<double, double> d_d;
typedef vector<int> Vint;

#define PI 3.141592653589793238462643383279
#define mod 1000000007LL
#define rep(i, n) for(i = 0;i < n;++i)
#define rep1(i, n) for(i = 1;i < n;++i)
#define rep2d(i, j, n) for(i = 0;i < n;++i)for(j = i + 1;j < n;++j)
#define per(i, n) for(i = n - 1;i > -1;--i)
#define int(x) int x; scanf("%d",&x)
#define int2(x, y) int x, y; scanf("%d%d",&x, &y)
#define int3(x, y, z) int x, y, z; scanf("%d%d%d",&x, &y, &z)
#define int4(v, x, y, z) int v, x, y, z; scanf("%d%d%d%d", &v, &x, &y, &z)
#define int5(v, w, x, y, z) int v, w, x, y, z; scanf("%d%d%d%d%d", &v, &w, &x, &y, &z)
#define scn(n, a) rep(i, n)cin >> a[i]
#define sc2n(n, a, b) rep(i, n)cin >> a[i] >> b[i]
#define pri(x) cout << x << "\n"
#define pri2(x, y) cout << x << " " << y << "\n"
#define pri3(x, y, z) cout << x << " " << y << " " << z << "\n"
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define endl "\n"
#define kabe puts("---------------------------")
#define kara puts("")
#define debug(x) cout << " --- " << x << "\n"
#define debug2(x, y) cout << " --- " << x << " " << y << "\n"
#define debug3(x, y, z) cout << " --- " << x << " " << y << " " << z << "\n"
#define X first
#define Y second
#define eps 0.0001
#define prid(x) printf("%.15lf\n", x)


signed main(void){
  int i, j, k;
  for(int testcase = 0;testcase >= 0;testcase++){
    int a[4], b[2];
    scn(4, a); scn(2, b);
    sort(a, a + 4); sort(b, b + 2);
    pri(a[1] + a[2] + a[3] + b[1]);


/*/

//*/ break;
  }
  return 0;
}

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

int main(){
  int A[4],e,f,ans=0;
    for(int i=0;i<4;i++){
      cin>>A[i];
    }
    sort(A,A+4);
    reverse(A,A+4);
    cin>>e>>f;
    if(e<f)
      ans+=f;
    else if(e>=f)
      ans+=e;

  cout<<A[0]+A[1]+A[2]+ans<<endl;

      return 0;

}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
const long long MOD = 1000000007;
using namespace std;
typedef long long ll;
map<ll, int> mp;
signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	vector<int> sci(4);
	vector<int> soc(2);
	for (int i = 0; i < 4; i++) {
		cin >> sci[i];
	}
	for (int i = 0; i < 2; i++) {
		cin >> soc[i];
	}
	sort(sci.rbegin(), sci.rend());
	sort(soc.rbegin(), soc.rend());
	cout << sci[0] + sci[1] + sci[2] + soc[0] << endl;
	return 0;
}

C++: #include<iostream>
#include<algorithm>
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);
	reverse(a, a + 4);
	reverse(b, b + 2);
	cout << a[0] + a[1] + a[2] + b[0] << endl;
	return 0;
}

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

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

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(void){
    int a[4];
    int b[2];
    
    for(int i=0;i<4;i++)
        cin >>a[i] ;
        
        sort(a,a+4);
    
    
    for(int i=0;i<2;i++)
        cin >>b[i] ;
        
        sort(b,b+2);
    
    
    cout<<a[1]+a[2]+a[3]+b[1]<<endl;
    
    
    
}

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

int main(){
  int a,b,c;
  c = 0;
  vector<int> v;
  for(int i = 0;i < 4;i++){
    cin >> a;
    v.push_back(a);
  }
  cin >> a >> b;
  sort(v.begin(),v.end());
  for(int i = 1;i < v.size();i++){
    c += v[i];
  }
  c += max(a,b);
  cout << c << endl;
  return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
using namespace std;

int main()
{
	vector<int> science(4);
	vector<int> social(2);
	cin >> science[0] >> science[1] >> science[2] >> science[3] >> social[0] >> social[1];
	sort(science.rbegin(), science.rend());
	sort(social.rbegin(), social.rend());
	cout << science[0] + science[1] + science[2] + social[0] << 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;
	cout << A + B + C + D + E + F - min(A, min(B, min(C, D))) - min(E, F) << endl;
}

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

int i, sumrika, sumsha, t, u, cnt=0;
int rika[5], sha[3];
int main(){
	int minrika=110, minsha=110;
	for(i=1; i<=4; i++){
	  cin>>rika[i]; sumrika+=rika[i];
	  if(rika[i]<minrika) {minrika=rika[i];}
	}
	for(i=1; i<=2; i++){
		cin>>sha[i]; sumsha+=sha[i];
		if(sha[i]<minsha) {minsha=sha[i];}
	}
	int disp = (sumrika-minrika)+(sumsha-minsha);
	cout << disp << endl;
}

C++: #include <cstdio>
#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);
	int x;
	x = a + b + c + d + e + f - min(a, min(b, min(c, d))) - min(e, f);
	printf("%d\n", x);

	return 0;
}

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

int main(){
    int a,b,c,d,e,f;
    cin >>a>>b>>c>>d>>e>>f;
    score[]={a,b,c,d};
    sort(score.begin(),score.end())
    score2[]={e,f};
    sort(score2.begin(),score2.end())
    cout <<score[1]+score[2]+score[3]+score2[1]<<endl;
    
    return 0;
}

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

using namespace std;

#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define REP3(i, m, n) for(int i = m, i##_len=(n);i < i##_len;i++)
#define FORVEC(i, v) for(int i = 0;i < v.size();i++)

#define INF 1000000000
#define pb(a) push_back(a)
#define llong long long
#define vi vector<int>
#define P pair<int,int>
#define all(vec) (vec.begin()),(vec.end())

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)<<"\n";
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int a[6],i,w,x,j;
	for(i=0;i<6;i++){
		scanf("%d",&a[i]);
	}
	for(i=0;i<3;i++){
		for(j=i+1;j<4;j++){
			if(a[i]<a[j]){
				w=a[i];
				a[i]=a[j];
				a[j]=w;
			}
		}
	}
	if(a[4]>a[5]){
		x=a[0]+a[1]+a[2]+a[4];
	}
	else{
		x=a[0]+a[1]+a[2]+a[5];
	}
	printf("%d\n",x);
	return 0;
}