#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 10, Max = 50, inf = 1e8;
int dp[maxn][Max], a[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i < Max; i++) {
    dp[0][i] = inf;
  }
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    int x1 = x / 100, x2 = x1 / 10;
    for (int j = 0; j < Max; j++) {
      int A = inf, B = inf;
      if (j >= x2) A = dp[i - 1][j - x2] + x1;
      if (j + x1 < Max) B = dp[i - 1][j + x1];
      dp[i][j] = min(A, B);
    }
    for (int j = 1; j < x1; j++) {
      dp[i][0] = min(dp[i][0], dp[i - 1][j] + x1 - j);
    }
  }
  int ans = inf;
  for (int i = 0; i < Max; i++) {
    ans = min(ans, dp[n][i]);
  }
  return cout << ans * 100 << endl, 0;
}
