#include <bits/stdc++.h>
using namespace std;
int n, m, k, kq;
int a[110];
int tong;
int dem[110];
void solve() {
  kq = tong;
  for (int i = 1; i <= 100; i++) {
    if (dem[i] == 2) {
      kq = min(kq, tong - dem[i] * i);
    }
    if (dem[i] > 2) {
      kq = min(kq, tong - 3 * i);
    }
  }
  printf("%d\n", kq);
}
int main() {
  int i, j;
  tong = 0;
  for (int i = 0; i < 5; i++) {
    scanf("%d", &a[i]);
    dem[a[i]]++;
    tong += a[i];
  }
  solve();
  return 0;
}
