#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[200] = {0}, b[5], sum = 0, max;
  for (int i = 0; i < 5; i++) {
    cin >> b[i];
    sum += b[i];
    a[b[i]]++;
  }
  max = sum;
  for (int i = 0; i < 5; i++) {
    if (a[b[i]] == 2) {
      if (sum - 2 * b[i] < max) max = sum - 2 * b[i];
    }
    if (a[b[i]] > 2) {
      if (sum - 3 * b[i] < max) max = sum - 3 * b[i];
    }
  }
  cout << max;
}
