#include <bits/stdc++.h>
using namespace std;
vector<int> w;
long long a[6], sum, num, sam, maxi = -10e9, maxn = -10e9, mini = 10e9,
                               minn = 10e9;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  for (int i = 1; i <= 5; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sort(a + 1, a + 6);
  for (int i = 1; i <= 5; i++) {
    num += a[i];
    sam++;
    if (a[i] != a[i + 1] && sam == 1) {
      sam = 0;
      num = 0;
    }
    if (a[i] != a[i + 1] && sam > 1 || sam == 3 || i == 5 && sam != 1) {
      w.push_back(num);
      num = 0;
      sam = 0;
    }
  }
  sort(w.begin(), w.end());
  cout << sum - w[w.size() - 1];
  return 0;
}
