#include <bits/stdc++.h>
using namespace std;
const long long inf = 9.2e18;
const int maxn = 300007;
const int INF = 2.1e9;
const int MOD = 1e9 + 7;
const double dif = 1e-7;
const double PI = 3.14159265358979323846;
int n, m, k, sum = 0;
int a[maxn], pre[maxn];
bool check(int x) {
  int d = sum - k, s = 0, flag1 = 0, flag2 = 0;
  if (d > k / 10) return false;
  int i;
  for (i = n; i >= 1; i--) {
    if (s >= d) break;
    s += a[i];
    if (a[i] == 10) flag1 = 1;
    if (a[i] == 20) flag2 = 1;
  }
  if (pre[i] >= d * 10)
    return true;
  else if (flag1 && s - d >= 10 && d * 10 - pre[i] <= 10)
    return true;
  else if (flag2 && d * 10 - pre[i] <= 10) {
    for (; i >= 1; i--)
      if (a[i] == 10) return pre[i - 1] >= 100;
  }
  return false;
}
int main(void) {
  while (cin >> n) {
    pre[0] = 0;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      a[i] /= 100;
      pre[i] = pre[i - 1] + a[i];
    }
    sum = pre[n];
    k = sum / 11 * 10;
    while (!check(k)) k++;
    cout << k * 100 << endl;
  }
  return 0;
}
