#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  ios_base::sync_with_stdio(false);
  int a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  int sum = a + b + c + d + e;
  int mm = a + b + c + d + e;
  for (int i = 100; i >= 1; i--) {
    int calc = 0;
    if (a == i) {
      calc++;
    }
    if (b == i) {
      calc++;
    }
    if (c == i) {
      calc++;
    }
    if (d == i) {
      calc++;
    }
    if (e == i) {
      calc++;
    }
    calc = min(calc, 3);
    if (calc > 1) {
      mm = min(mm, sum - calc * i);
    }
  }
  cout << mm << endl;
  return 0;
}
