#include <bits/stdc++.h>
using namespace std;
int main() {
  int A[5], c, t, max, maxs, sum, d;
  sum = maxs = c = 0;
  for (int i = 0; i < 5; i++) {
    scanf("%d", &A[i]);
    sum += A[i];
  }
  for (int i = 0; i < 5; i++) {
    d = A[i];
    max = 0;
    t = 0;
    if (A[i] != -1) {
      for (int j = 0; j < 5; j++)
        if (d == A[j]) {
          max++;
          t += A[j];
          A[j] = -1;
        }
    }
    if (maxs < t && max > 1) maxs = t;
    if (c < max) c = max;
  }
  if (c == 5)
    sum = sum / 5 * 2;
  else if (c == 4)
    sum -= maxs / 4 * 3;
  else if (c == 2 || c == 3)
    sum -= maxs;
  printf("%d", sum);
  return 0;
}
