#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[6];
  int b[101];
  while (cin >> a[0] >> a[1] >> a[2] >> a[3] >> a[4]) {
    memset(b, 0, sizeof(b));
    sort(a, a + 5);
    int sum = 0;
    for (int i = 0; i < 5; i++) {
      sum += a[i];
      b[a[i]]++;
    }
    int tmp = 0, maxx = 0;
    for (int i = 0; i <= 100; i++) {
      if (b[i] == 2) {
        tmp = i * 2;
        if (tmp >= maxx) maxx = tmp;
      }
      if (b[i] > 2) {
        tmp = i * 3;
        if (tmp >= maxx) maxx = tmp;
      }
    }
    cout << sum - maxx << endl;
  }
  return 0;
}
