#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr[105] = {0};
  int sum = 0;
  int ans = INT_MAX;
  int mx = INT_MIN;
  for (int t, i = 1; i <= 5; i++) {
    cin >> t;
    sum += t;
    mx = max(mx, t);
    arr[t]++;
  }
  int ans1 = sum, ans2 = sum;
  int cans1;
  for (int i = mx; i >= 1; i--) {
    if (arr[i] == 2) {
      cans1 = sum;
      cans1 -= 2 * i;
      ans1 = min(cans1, ans1);
    }
    if (arr[i] >= 3) {
      ans2 -= i * 3;
    }
  }
  ans = min(sum, min(ans1, ans2));
  cout << ans << "\n";
}
