#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  char ch = getchar();
  long long x = 0, f = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long n, ans = (1ll << 60), f[300005][35];
int main() {
  n = read();
  memset(f, 7, sizeof f);
  f[0][0] = 0;
  for (long long i = 0; i <= n - 1; ++i) {
    long long x = read() / 100;
    for (long long j = 0; j <= 31; ++j)
      f[i + 1][j + x / 10] = min(f[i + 1][j + x / 10], f[i][j] + x);
    for (long long j = 1; j <= 31; ++j)
      f[i + 1][j - min(x, j)] =
          min(f[i + 1][j - min(x, j)], f[i][j] + x - min(x, j));
  }
  for (long long i = 0; i <= 31; ++i) ans = min(ans, f[n][i]);
  printf("%lld\n", ans * 100);
}
