#include <bits/stdc++.h>
using namespace std;
int main() {
  int t[5], sum = 0, val = 0;
  map<int, int> mp;
  for (int i = 0; i < 5; i++) {
    cin >> t[i];
    mp[t[i]]++;
    sum = sum + t[i];
  }
  map<int, int>::iterator it;
  int maximum = 0;
  for (it = mp.begin(); it != mp.end(); it++) {
    if (it->second == 2) {
      val = it->second;
      it->second = it->first * 2;
    } else if (it->second >= 3) {
      val = it->second;
      it->second = it->first * 3;
    } else
      it->second = 0;
    if (maximum < it->second) maximum = it->second;
  }
  cout << sum - maximum << endl;
  mp.clear();
  return 0;
}
