#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long a[n + 1];
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] /= 100;
  }
  long long dp[n + 1][35];
  dp[0][0] = 0;
  for (long long i = 1; i < 35; i++) dp[0][i] = 1000000000000;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j < 35; j++) {
      dp[i][j] = 1000000000000;
      for (long long k = 1; k <= a[i]; k++) {
        if ((k + j) >= 35) goto here;
        dp[i][j] = min(dp[i][j], dp[i - 1][j + k] + a[i] - k);
      }
    here:
      if ((j - a[i] / 10) >= 0)
        dp[i][j] = min(dp[i][j], dp[i - 1][j - (a[i] / 10)] + a[i]);
    }
  }
  long long ans = 1000000000000;
  for (long long j = 0; j < 35; j++) ans = min(ans, dp[n][j]);
  ans *= 100;
  cout << ans << endl;
  return 0;
}
