#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e5 + 10;
const int INF = 1e9;
int n, a[MAXN], f[35], g[35];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= 31; ++i) g[i] = INF;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    a[i] /= 100;
    f[0] = f[1] = INF;
    for (int j = a[i] / 10; j <= 31; ++j) f[j] = g[j - a[i] / 10] + a[i];
    for (int j = a[i]; j <= 31; ++j) f[j - a[i]] = min(f[j - a[i]], g[j]);
    for (int j = 1; j < a[i]; ++j) f[0] = min(f[0], g[j] + a[i] - j);
    for (int j = 0; j <= 31; ++j) g[j] = f[j];
  }
  for (int i = 1; i <= 31; ++i) g[0] = min(g[0], g[i]);
  printf("%d\n", g[0] * 100);
  return 0;
}
