#include <bits/stdc++.h>
using namespace std;
long long a[400010];
int main() {
  long long n;
  cin >> n;
  long long sum = 0, count = 0;
  for (long long i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
    sum += (a[i] / 1000);
    if (a[i] == 1000) count++;
  }
  long long tmp;
  if (sum <= 11)
    tmp = sum - a[n - 1] / 1000;
  else
    tmp = 10 * sum / 11;
  if (count == 0) {
    if (tmp % 2 == 1) tmp--;
  }
  printf("%lld\n", 1ll * 1000 * sum - 1ll * tmp * 100);
}
