#include <bits/stdc++.h>
using namespace std;
int a, b, x, i, m[105];
int main() {
  while (i < 5) {
    cin >> a;
    b += a;
    m[a]++;
    i++;
  }
  i = 0;
  while (i < 105) {
    if (m[i] > 1) x = max(x, i * min(m[i], 3));
    i++;
  }
  cout << b - x;
}
