#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int t[5];
  int a[5];
  while (~scanf("%d%d%d%d%d", &t[0], &t[1], &t[2], &t[3], &t[4])) {
    sort(t, t + 5);
    int ans = 0, ma = 0, mark = 0;
    int tim = 1;
    int j = 0;
    for (int i = 0; i < 4; i++) {
      if (t[i] != t[i + 1]) {
        a[j++] = tim;
        tim = 0;
      }
      if (t[i] != t[i + 1] && i == 3) {
        a[j++] = 1;
      }
      if (t[i] == t[i + 1] && i == 3) {
        a[j++] = tim + 1;
      }
      tim++;
    }
    ma = 0;
    tim = 0;
    for (int i = 0; i < j; i++) {
      tim += a[i];
      if (a[i] <= 3 && a[i] > 1)
        ma = max(ma, a[i] * t[tim - 1]);
      else if (a[i] > 3)
        ma = max(ma, 3 * t[tim - 1]);
    }
    printf("%d\n", t[0] + t[1] + t[2] + t[3] + t[4] - ma);
  }
  return 0;
}
