#include <bits/stdc++.h>
using namespace std;
int main() {
  int count[105] = {0};
  int arr[10];
  int sum = 0, res = 100000;
  for (int i = 0; i < 5; i++) {
    cin >> arr[i];
    count[arr[i]]++;
    sum += arr[i];
  }
  for (int i = 100; i > 0; i--) {
    if (count[i] > 1) {
      res = min(sum - i * 2, res);
    }
    if (count[i] > 2) {
      res = min(sum - i * 3, res);
    }
  }
  cout << min(res, sum);
  return 0;
}
