#include <bits/stdc++.h>
using namespace std;
const long long int N = 3e5 + 5, N2 = 100, inf = 1e18;
long long int ary[N];
long long int dp[N][N2 + 1];
long long int solve(long long int i, long long int b, long long int n) {
  if (i == n) {
    return 0;
  }
  if (dp[i][b] == -1) {
    dp[i][b] = inf;
    if (b + ary[i] / 10 > N2) {
      dp[i][b] = solve(i + 1, b - ary[i], n);
    } else {
      dp[i][b] = ary[i] + solve(i + 1, b + ary[i] / 10, n);
      if (b >= ary[i])
        dp[i][b] = min(dp[i][b], solve(i + 1, b - ary[i], n));
      else
        dp[i][b] = min(dp[i][b], solve(i + 1, 0, n) + ary[i] - b);
    }
  }
  return dp[i][b];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  for (long long int i = 0; i < n; ++i) {
    cin >> ary[i];
    ary[i] /= 100;
  }
  memset(dp, -1, sizeof(dp));
  cout << solve(0, 0, n) * 100 << "\n";
  return 0;
}
