#include <bits/stdc++.h>
using namespace std;
char ch;
int n, a[300002];
long long f[300002][41], ans;
inline void read(int &x) {
  x = 0;
  do {
    ch = getchar();
  } while (ch < '0' || '9' < ch);
  do {
    x = x * 10 + ch - '0';
    ch = getchar();
  } while ('0' <= ch && ch <= '9');
}
inline void read(long long &x) {
  x = 0;
  do {
    ch = getchar();
  } while (ch < '0' || '9' < ch);
  do {
    x = x * 10 + ch - '0';
    ch = getchar();
  } while ('0' <= ch && ch <= '9');
}
inline void updata(long long &x, const long long &y) { x = min(x, y); }
int main(void) {
  read(n);
  for (int i = (1); i <= (n); i++) read(a[i]), a[i] /= 100;
  memset(f, 0x3f, sizeof(f));
  f[0][0] = 0;
  for (int i = 0; i < (n); i++)
    for (int j = 0; j < (41); j++) {
      if (j + a[i + 1] / 10 <= 40)
        updata(f[i + 1][j + a[i + 1] / 10], f[i][j] + a[i + 1]);
      updata(f[i + 1][max(0, j - a[i + 1])], f[i][j] + max(0, a[i + 1] - j));
    }
  ans = 0x3f3f3f3f;
  for (int i = 0; i < (41); i++) updata(ans, f[n][i]);
  printf("%d", ans * 100);
  return 0;
}
