#include <bits/stdc++.h>
using namespace std;
string long_sum(string a, string b) {
  string ans = "";
  int r = 0;
  if (a < b) swap(a, b);
  if (a.size() < b.size()) swap(a, b);
  ans = a;
  for (; b.size() < a.size();) {
    b = '0' + b;
  }
  for (int i = a.size() - 1; i >= 0; i--) {
    ans[i] = a[i] + b[i] + r - '0';
    r = 0;
    if (ans[i] > '9') {
      r = 1;
      ans[i] = ans[i] - 10;
    }
  }
  if (r > 0) {
    ans = char(r + '0') + ans;
  }
  return ans;
}
int main() {
  int m = 0, a[5], sum = 0;
  for (int i = 0; i < 5; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sort(a, a + 5);
  for (int i = 1; i < 5; i++) {
    if (a[i] == a[i - 1]) m = max(m, a[i] * 2);
  }
  for (int i = 2; i < 5; i++) {
    if (a[i] == a[i - 1] && a[i] == a[i - 2]) m = max(m, a[i] * 3);
  }
  cout << sum - m;
  return 0;
}
