#include <bits/stdc++.h>
using namespace std;
int main() {
  map<int, int> m;
  long long int sum = 0, prev = 0;
  for (int i = 0; i < 5; i++) {
    int num;
    cin >> num;
    if (m.find(num) != m.end())
      m[num] += 1;
    else
      m[num] = 1;
    sum += num;
  }
  prev = sum;
  long long int res = sum;
  for (auto it : m) {
    if (it.second == 2) {
      prev = sum - (2 * it.first);
      res = min(prev, res);
    }
    if (it.second >= 3) {
      prev = sum - (3 * it.first);
      res = min(prev, res);
    }
  }
  cout << res << endl;
  return 0;
}
