#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, i, sum = 0, sum_3 = 0, sum_2 = 0;
  int a[100] = {0};
  for (i = 1; i <= 5; i++) {
    cin >> x;
    a[x - 1]++;
    sum += x;
  }
  sum_3 = sum;
  sum_2 = sum;
  for (i = 99; i >= 0; i--) {
    if (a[i] != 0) {
      if (a[i] >= 3) {
        sum_3 = sum_3 - 3 * (i + 1);
        break;
      }
    }
  }
  for (i = 99; i >= 0; i--) {
    if (a[i] != 0) {
      if (a[i] == 2) {
        sum_2 = sum_2 - 2 * (i + 1);
        break;
      }
    }
  }
  cout << min(sum_3, sum_2) << endl;
  return 0;
}
