#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int a, b, c, d, e, s, f[110], g;
int main() {
  ios::sync_with_stdio(false);
  cin >> a >> b >> c >> d >> e;
  f[a]++, f[b]++, f[c]++, f[d]++, f[e]++;
  s = a + b + c + d + e;
  if (f[a] >= 2) g = max(g, a * min(3, f[a]));
  if (f[b] >= 2) g = max(g, b * min(3, f[b]));
  if (f[c] >= 2) g = max(g, c * min(3, f[c]));
  if (f[d] >= 2) g = max(g, d * min(3, f[d]));
  if (f[e] >= 2) g = max(g, e * min(3, f[e]));
  cout << s - g;
  return 0;
}
