#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void chkmax(T& x, U y) {
  if (x < y) x = y;
}
template <typename T, typename U>
inline void chkmin(T& x, U y) {
  if (y < x) x = y;
}
int dp[2][60];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= 41; i++) dp[0][i] = -1e9;
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    x /= 100;
    sum += x;
    int now = i & 1;
    for (int j = 0; j <= 41; j++) dp[now][j] = -1e9;
    for (int j = 0; j <= 41 - x / 10; j++)
      chkmax(dp[now][j + x / 10], dp[!now][j]);
    for (int j = 0; j <= 41; j++)
      chkmax(dp[now][max(j - x, 0)], dp[!now][j] + min(j, x));
    for (int j = 40; j >= 0; j--) chkmax(dp[now][j], dp[now][j + 1]);
  }
  int ans = 0;
  for (int j = 0; j <= 41; j++) chkmax(ans, dp[n & 1][j]);
  cout << (sum - ans) * 100 << endl;
  return 0;
}
