#include <bits/stdc++.h>
using namespace std;
long long int n, a[100] = {}, r = 0, s = 0, m;
int main() {
  ios_base::sync_with_stdio(0);
  for (long long int i = 1; i <= 5; i++) {
    cin >> m;
    a[m]++;
    s += m;
    if (a[m] == 2 || a[m] == 3) r = max(r, m * a[m]);
  }
  cout << s - r;
  return 0;
}
