#include <bits/stdc++.h>
using namespace std;
int h[1005], sum, x, d, i, n;
int main() {
  memset(h, 0, sizeof h);
  x = 0;
  sum = d = 0;
  for (i = 0; i < 5; i++) {
    cin >> x;
    h[x]++;
    sum += x;
  }
  for (i = 0; i <= 100; i++) {
    if (h[i] == 2) {
      d = max(d, i * 2);
    } else if (h[i] > 2) {
      d = max(d, i * 3);
    }
  }
  cout << sum - d << endl;
  return 0;
}
