#include <bits/stdc++.h>
using namespace std;
bool _compare(int a, int b) {
  if (a > b) return true;
  return false;
}
int main() {
  int i, j, k, x, y, ar[5], checker[102], sum, minimum, value;
  memset(checker, 0, sizeof(checker));
  sum = 0;
  for (i = 0; i < 5; i++) {
    scanf("%d", &ar[i]);
    checker[ar[i]]++;
    sum += ar[i];
  }
  sort(ar, ar + 5, _compare);
  value = minimum = sum;
  for (j = 0; j < 5; j++) {
    x = ar[j];
    if (checker[x] > 1 && x != y) {
      i = min(checker[x], 3);
      value = sum - i * x;
    }
    minimum = min(minimum, value);
    y = x;
  }
  cout << minimum << endl;
}
