#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a[5], max = 0, sum = 0;
  unordered_set<long long> x;
  for (long long i = 0; i < 5; i++) {
    cin >> a[i];
    sum += a[i];
    x.insert(a[i]);
  }
  for (auto b : x) {
    long long temp = count(a, a + 5, b);
    if (temp > 3) {
      temp = 3;
    } else if (temp == 1) {
      temp = 0;
    }
    if (b * temp > max) {
      max = b * temp;
    }
  }
  cout << sum - max << endl;
}
