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