#include <bits/stdc++.h>
using namespace std;
const int MAXC = 305;
const int MAXN = 300005;
const int INF = 1000000000;
int A[MAXN], dp[2][MAXC];
int main(int argc, char const *argv[]) {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &A[i]);
    A[i] /= 100;
  }
  for (int i = 0; i < MAXC; ++i) {
    dp[0][i] = dp[1][i] = INF;
  }
  dp[0][0] = 0;
  for (int i = 1; i <= n; ++i) {
    int curr = i % 2, prev = (i + 1) % 2;
    for (int j = 0; j < MAXC; ++j) {
      int nv = j + A[i] / 10;
      if (nv < MAXC) {
        dp[curr][nv] = min(dp[curr][nv], dp[prev][j] + A[i]);
      }
      int to_sub = min(j, A[i]);
      nv = j - to_sub;
      dp[curr][nv] = min(dp[curr][nv], dp[prev][j] + A[i] - to_sub);
      dp[prev][j] = INF;
    }
  }
  int ans = INF;
  for (int i = 0; i < MAXC; ++i) {
    ans = min(ans, dp[n % 2][i]);
  }
  printf("%d\n", ans * 100);
  return 0;
}
