#include <bits/stdc++.h>
using namespace std;
int main() {
  map<int, int> m;
  int sum = 0, a;
  for (int i = 0; i < 5; i++) {
    cin >> a;
    m[a]++;
    sum += a;
  }
  int temp = 0;
  for (auto i : m) {
    if (i.second == 2) temp = max(temp, i.first * 2);
    if (i.second >= 3) temp = max(temp, i.first * 3);
  }
  cout << sum - temp;
}
