#include <bits/stdc++.h>
using namespace std;
int n, a[303030], sum, s[303030];
bool ok(int k) {
  int x = k * 10, y = sum - k * 11, ans = x + y;
  int xx = x, now = 1;
  while (xx >= a[now]) {
    xx -= a[now];
    now++;
  }
  if (!xx) return 1;
  for (int i = now; i <= n; i++)
    if (a[i] == 10) {
      if (y + s[now - 1] / 10 >= s[i - 1] - s[now - 1]) return 1;
      break;
    }
  for (int i = now - 1; i >= 1; i--)
    if (a[i] == 10) {
      if (y + s[i - 1] / 10 >= 10) return 1;
    }
  return 0;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), a[i] /= 100;
  s[0] = 0;
  for (int i = 1; i <= n; i++) s[i] = a[i] + s[i - 1];
  if (n == 1) {
    printf("%d00\n", a[1]);
    return 0;
  }
  sum = s[n];
  int k = sum / 11;
  if (ok(k)) {
    printf("%d00\n", sum - k);
    return 0;
  }
  if (ok(k - 1)) {
    printf("%d00\n", sum - k + 1);
    return 0;
  }
  assert(0);
  printf("%d00\n", sum - k + 2);
  return 0;
}
