#include <bits/stdc++.h>
const double PI = acos(-1);
const int MAXX = 10005;
const int maxInt = 2147483647;
using namespace std;
int a[300010], n;
inline int read() {
  int k = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    k = k * 10 + ch - '0';
    ch = getchar();
  }
  return k * f;
}
int main() {
  n = read();
  int sa = 0, sb = 0;
  for (int i = 1; i <= n; i++) a[i] = read();
  for (int i = 1; i <= n; i++) sa += a[i] / 1000, sb += (a[i] == 1000);
  int S = sa * 10 / 11;
  if (sa <= 11) S = sa - a[n] / 1000;
  if (sb == 0 && (S & 1)) S--;
  printf("%d", sa * 1000 - S * 100);
  return 0;
}
