#include <bits/stdc++.h>
using namespace std;
int main() {
  int t1, t2, t3, t4, t5, n, sum, b[7] = {0, 0, 0, 0, 0, 0, 0};
  cin >> t1 >> t2 >> t3 >> t4 >> t5;
  int a[5] = {t1, t2, t3, t4, t5};
  sum = t1 + t2 + t3 + t4 + t5;
  sort(a, a + 5);
  if (a[4] == a[3] && a[3] == a[2]) b[0] = a[4] + a[3] + a[2];
  if (a[4] == a[3]) b[1] = a[4] + a[3];
  if (a[3] == a[2] && a[2] == a[1]) b[2] = a[1] + a[2] + a[3];
  if (a[2] == a[3]) b[3] = a[3] + a[2];
  if (a[2] == a[1] && a[0] == a[1]) b[4] = a[0] + a[2] + a[1];
  if (a[2] == a[1]) b[5] = a[1] + a[2];
  if (a[0] == a[1]) b[6] = a[0] + a[1];
  n = b[0];
  for (int i = 1; i < 7; i++) {
    if (n < b[i]) n = b[i];
  }
  cout << sum - n << endl;
  return 0;
}
