#include <bits/stdc++.h>
#define fo(i,a) for(i = 0;i < a;i++)
using namespace std;

int main(void)
{
	int t,h,s[4]={0};
	
	fo(t,4){
		cin >> s[t];
	}
	sort(s,s+4);
	cin >> h;
	cin >> t;
	s[0] = max(h,t);
	cout << s[0]+s[1]+s[2]+s[3] << endl;
	
	return 0;
}