#include <bits/stdc++.h>
using namespace std;
long long n;
long long a[300005];
long long dp[300005][105];
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (long long(i) = (1); (i) <= (n); (i)++) cin >> a[i], a[i] /= 100;
  for (long long(i) = (0); (i) <= (n); (i)++)
    for (long long(j) = (0); (j) <= (100); (j)++) dp[i][j] = 1e18;
  dp[0][0] = 0;
  for (long long(i) = (0); (i) <= (n - 1); (i)++) {
    for (long long(j) = (0); (j) <= (100); (j)++) {
      long long x = min(j, a[i + 1]);
      (dp[i + 1][j - x]) = min((dp[i + 1][j - x]), (dp[i][j] + a[i + 1] - x));
      if (j + a[i + 1] / 10 <= 100)
        (dp[i + 1][j + a[i + 1] / 10]) =
            min((dp[i + 1][j + a[i + 1] / 10]), (dp[i][j] + a[i + 1]));
    }
  }
  long long ans = 1e18;
  for (long long(i) = (0); (i) <= (100); (i)++) (ans) = min((ans), (dp[n][i]));
  cout << ans * 100 << endl;
  return 0;
}
