#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
void smin(T &a, U b) {
  if (a > b) a = b;
}
const long long mod = 1000000007;
const int N = 3e5 + 10;
const int M = 2e6;
int n, a[N], dp[N][66];
int main() {
  cin >> n;
  for (int i = 0; i <= n - 1; i++) {
    scanf("%d", a + i);
    a[i] /= 100;
  }
  memset(dp, 63, sizeof dp);
  dp[0][0] = 0;
  for (int i = 0; i < n; ++i)
    for (int b = 0; b <= 60; ++b) {
      { smin(dp[i + 1][a[i] / 10 + b], dp[i][b] + a[i]); }
      {
        for (int first = 1; first <= min(b, a[i]); ++first)
          smin(dp[i + 1][b - first], dp[i][b] + a[i] - first);
      }
    }
  int res = mod;
  for (int b = 0; b <= 60; ++b) smin(res, dp[n][b]);
  cout << res << "00\n";
}
