#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:10240000,10240000")
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-10;
inline int read() {
  static char ch;
  bool sgn = false;
  while (ch = getchar(), ch < '0' || ch > '9')
    if (ch == '-') sgn = true;
  int res = ch - 48;
  while (ch = getchar(), ch >= '0' && ch <= '9') res = res * 10 + ch - 48;
  return sgn ? -res : res;
}
int num[101], sum;
int main() {
  for (int i = 1; i <= 5; i++) {
    int x = read();
    num[x]++;
    sum += x;
  }
  int ans = sum;
  for (int i = 1; i <= 100; i++) {
    if (num[i] >= 2) ans = min(ans, sum - 2 * i);
    if (num[i] >= 3) ans = min(ans, sum - 3 * i);
  }
  cout << ans;
}
