#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e3 + 5;
int a[5];
int main() {
  int n, sum = 0, f = 0;
  for (int i = 0; i < 5; i++) scanf("%d", &a[i]), sum += a[i];
  sort(a, a + 5);
  int sum1 = sum;
  for (int i = 4; i >= 2; i--) {
    if (a[i] == a[i - 1] && a[i] == a[i - 2]) {
      sum1 -= a[i] * 3;
      break;
    }
  }
  for (int i = 4; i >= 1; i--) {
    if (a[i] == a[i - 1]) {
      sum -= a[i] * 2;
      break;
    }
  }
  printf("%d\n", min(sum, sum1));
  return 0;
}
