#include <bits/stdc++.h>
using namespace std;
inline long long mod(long long n, long long m) {
  long long ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
long long gcd(long long a, long long b) {
  return (b == 0LL ? a : gcd(b, a % b));
}
long long exp(long long a, long long b, long long m) {
  if (b == 0LL) return 1LL;
  if (b == 1LL) return mod(a, m);
  long long k = mod(exp(a, b / 2, m), m);
  if (b & 1LL) {
    return mod(a * mod(k * k, m), m);
  } else
    return mod(k * k, m);
}
int n;
const int N = 300100, MX = 100, inf = 1e9;
int a[N];
int dp[N][MX + 1];
int solve(int id, int j) {
  if (id > n) return 0;
  if (j >= MX) {
    return solve(id + 1, j - a[id]);
  }
  int& x = dp[id][j];
  if (x != -1) return x;
  x = inf;
  if (j > 0) {
    int put = min(j, a[id]);
    x = solve(id + 1, j - put) + a[id] - put;
  }
  return x = min(x, solve(id + 1, j + a[id] / 10) + a[id]);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  memset(dp, -1, sizeof(dp));
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] /= 100;
  }
  cout << 100LL * solve(1, 0) << "\n";
}
