#include <bits/stdc++.h>
using namespace std;
int a[10], flag[200];
int main() {
  int sum = 0;
  for (int i = 1; i <= 5; i++) {
    cin >> a[i];
    sum += a[i];
    flag[a[i]]++;
  }
  int ans = sum;
  for (int i = 1; i <= 5; i++) {
    if (flag[a[i]] > 1 && flag[a[i]] < 4)
      ans = min(ans, sum - flag[a[i]] * a[i]);
    else if (flag[a[i]] > 3) {
      ans = min(ans, sum - 3 * a[i]);
    }
  }
  cout << ans << "\n";
  return 0;
}
