#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[101] = {0}, i, b, s = 0, j = 0, min = 999;
  for (i = 1; i <= 5; i++) {
    scanf("%d", &b);
    a[b]++;
  }
  for (i = 100; i >= 1; i--) {
    if (a[i] == 1)
      s = s + i;
    else if (a[i] == 2) {
      if (j == 0) {
        min = a[i] * i;
      }
      if (j == 1 && min != 999) {
        if (a[i] * i < min)
          s = s + a[i] * i;
        else
          s = s + min;
      }
      j = 1;
    } else if (a[i] == 3) {
      if (j == 0) {
        min = a[i] * i;
      }
      if (j == 1 && min != 999) {
        if (a[i] * i < min)
          s = s + a[i] * i;
        else
          s = s + min;
      }
      j = 1;
    } else if (a[i] == 4)
      s = s + i;
    else if (a[i] == 5)
      s = s + 2 * i;
  }
  printf("%d\n", s);
  return 0;
}
