#include <bits/stdc++.h>
using namespace std;
int* Sort(int* a, int n) {
  for (int i = 0; i < n; i++)
    for (int j = i; j < n; j++)
      if (a[j] > a[i]) swap(a[j], a[i]);
  return a;
}
int Count(int* a, int n, int num) {
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (num == a[i]) count++;
  }
  return count;
}
void Show(int* a, int n) {
  for (int i = 0; i < n; i++) cout << a[i] << " ";
}
int main() {
  int n = 5, s = 0;
  int* t = new int[n];
  for (int i = 0; i < n; i++) {
    cin >> t[i];
    s += t[i];
  }
  t = Sort(t, n);
  int count = 0;
  int max = 0;
  int best = s;
  for (int i = 0; i < n; i++) {
    count = 0;
    if (max != t[i]) {
      max = t[i];
      count = Count(t, n, max);
      if (count > 3) count = 3;
      if (count >= 2 && s - count * max < best) {
        best = s - count * max;
      }
    }
  }
  cout << best;
  return 0;
}
