#include <bits/stdc++.h>
using namespace std;
int const INF = 1000000005;
int main() {
  int n = 5, sum = 0;
  vector<int> card(6, -1);
  for (unsigned i = (1); i <= (n); i++) {
    cin >> card[i];
    sum += card[i];
  }
  sort(card.begin(), card.end());
  int best = 0;
  int count = 1;
  for (unsigned i = (1); i <= (5); i++) {
    if (card[i] == card[i - 1]) {
      count++;
      if (count <= 3) {
        best = max(best, count * card[i]);
      }
    } else {
      count = 1;
    }
  }
  cout << sum - best;
  return 0;
}
