#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 5, sum = 0;
  vector<int> v(5, 0);
  unordered_map<int, int> mm;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    mm[v[i]]++;
    sum += v[i];
  }
  int min = 0;
  for (int i = 0; i < 5; i++) {
    if (mm[v[i]] <= 3 && mm[v[i]] > 1) {
      if (min < (mm[v[i]] * v[i])) min = (mm[v[i]] * v[i]);
    } else if (mm[v[i]] > 3) {
      if (min < (v[i] * 3)) min = (v[i] * 3);
    }
  }
  cout << sum - min << endl;
}
