#include <bits/stdc++.h>
using namespace std;
const int N = 300005, INF = 0x3f3f3f3f;
int dp[N][31], s[N], n;
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  memset(dp, 0x3f, sizeof(dp));
  cin >> n;
  for (int i = 1; i <= (n); ++i) cin >> s[i], s[i] /= 100;
  dp[0][0] = 0;
  for (int i = 1; i <= (n); ++i) {
    for (int j = 0; j < (31); ++j)
      for (int k = 1; k <= (s[i]); ++k)
        if (j + s[i] < 31)
          dp[i][j] = min(dp[i][j], dp[i - 1][j + k] + s[i] - k);
    for (int j = 0; j < (31); ++j)
      if (j - s[i] / 10 >= 0)
        dp[i][j] = min(dp[i][j], dp[i - 1][j - s[i] / 10] + s[i]);
  }
  int ans = INF;
  for (int i = 0; i < (31); ++i) ans = min(ans, dp[n][i]);
  cout << ans * 100 << endl;
  return 0;
}
