#include <bits/stdc++.h>
using namespace std;
void fast();
int main() {
  fast();
  int card[5]{0}, sum = 0;
  for (int i = 0; i < 5; ++i) cin >> card[i], sum += card[i];
  sort(card, card + 5);
  int mx_sum = 0;
  for (int i = 0; i < 5; ++i) {
    if (i + 1 < 5 && card[i] == card[i + 1]) mx_sum = max(mx_sum, 2 * card[i]);
    if (i + 2 < 5 && card[i] == card[i + 2]) mx_sum = max(mx_sum, 3 * card[i]);
  }
  cout << sum - mx_sum;
  return 0;
}
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
}
