#include <bits/stdc++.h>
using namespace std;
int main() {
  int t[5];
  for (int i = 0; i < 5; i++) {
    cin >> t[i];
  }
  int a[101];
  for (int i = 0; i < 101; i++) {
    a[i] = 0;
  }
  int sum = 0;
  for (int i = 0; i < 5; i++) {
    a[t[i]]++;
    sum += t[i];
  }
  int maxi = 0;
  for (int i = 100; i > 0; i--) {
    if (a[i] >= 3) {
      int temp = 3 * i;
      maxi = max(maxi, temp);
    }
    if (a[i] == 2) {
      int temp = 2 * i;
      maxi = max(maxi, temp);
    }
  }
  cout << sum - maxi << endl;
  return 0;
}
