#include <bits/stdc++.h>
using namespace std;
const int N = 300000 + 10;
long long dp[N][40];
int n;
long long a[N];
int main() {
  memset(dp, 0x3f3f3f3f, sizeof(dp));
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    a[i] /= 100;
  }
  dp[0][0] = 0;
  for (int i = 1; i <= n; i++) {
    int cards = a[i] / 10;
    for (int j = 0; j <= 31; j++) {
      if (dp[i - 1][j] < 0x3f3f3f3f) {
        if (j + cards <= 31)
          dp[i][j + cards] = min(dp[i][j + cards], dp[i - 1][j] + a[i]);
        int b = min((long long)j, a[i]);
        if (b) {
          dp[i][j - b] = min(dp[i][j - b], dp[i - 1][j] + a[i] - b);
        }
      }
    }
  }
  long long ans = 0x3f3f3f3f;
  for (int i = 0; i < 20; i++) {
    if (dp[n][i] < ans) ans = dp[n][i];
  }
  printf("%I64d00\n", ans);
  return 0;
}
