#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;
}