#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, n = 5, i, a[5] = {0}, sum = 0, min, k, sum2, count = 0;
  for (i = 0; i < 5; i++) {
    cin >> a[i];
    sum += a[i];
  }
  min = sum;
  sum2 = sum;
  k = 0;
  count = 0;
  for (k = 0; k < 4; k++) {
    count = 0;
    sum = sum2;
    for (i = k + 1; i < 5; i++) {
      if (a[i] == a[k]) {
        count++;
      }
    }
    if (count == 1) {
      sum = sum - (a[k] * 2);
    } else if (count == 2) {
      sum = sum - (a[k] * 3);
    }
    if (sum < min) min = sum;
  }
  cout << min << endl;
  return 0;
}
