#include <bits/stdc++.h>
using namespace std;
const int N = 300000 + 10;
const int INF = 1e9 + 7;
const double EPS = 1e-8;
int n, a[N];
int dp[N][102];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), a[i] /= 100;
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= 50; j++) dp[i][j] = INF;
  dp[0][0] = 0;
  int ret = INF;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= 50; j++) {
      dp[i][j] = INF;
      if (j >= a[i] / 10)
        dp[i][j] = min(dp[i - 1][j - a[i] / 10] + a[i], dp[i][j]);
      for (int k = 1; k <= a[i]; k++)
        if (j + k <= 50) dp[i][j] = min(dp[i - 1][j + k] + a[i] - k, dp[i][j]);
      if (i == n) ret = min(ret, dp[i][j]);
    }
  }
  printf("%lld\n", (long long)ret * 100L);
}
