#include <bits/stdc++.h>
using namespace std;
int main() {
  int s = 0, r = 0;
  vector<int> d(5);
  for (int i = 0; i < 5; i++) cin >> d[i];
  sort(d.begin(), d.end());
  for (int i = 0, c = 1; i < d.size(); i++) {
    s += d[i];
    if (!i) continue;
    if (d[i] == d[i - 1]) {
      c++;
    } else {
      c = 1;
    }
    if (c == 2)
      r = max(r, d[i] * 2);
    else if (c > 2)
      r = max(r, d[i] * 3);
  }
  cout << s - r;
}
