#include <bits/stdc++.h>
using namespace std;
long long a[300100];
long long sum[300100];
int main() {
  long long ans = 0;
  int flag1 = 0, flag2 = 0;
  memset(a, 0, sizeof(a));
  memset(sum, 0, sizeof(sum));
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] != 1000) flag1 = 1;
    if (a[i] != 2000) flag2 = 1;
  }
  sum[0] = a[0];
  for (int i = 1; i < n; i++) {
    sum[i] = a[i] + sum[i - 1];
  }
  if (flag2 == 0) {
    int temp = sum[n - 1] % 22000;
    temp /= 2000;
    int v = sum[n - 1] / 22000;
    ans = v * 20000 + (temp - 1) * 0.9 * 2000 + 2000;
  } else if (flag1 == 0) {
    int temp = sum[n - 1] % 11000;
    temp /= 1000;
    int v = sum[n - 1] / 11000;
    ans = v * 10000 + (temp - 1) * 0.9 * 1000 + 1000;
  } else {
    if (sum[n - 1] > 22000) {
      int v = sum[n - 1] / 1100;
      ans = sum[n - 1] - v * 100;
    } else {
      if (a[n - 1] == 2000 || sum[n - 1] <= 11000)
        ans = sum[n - 1] - sum[n - 2] / 10;
      else
        ans = sum[n - 1] - sum[n - 2] / 10 + 100;
    }
  }
  cout << ans;
  return 0;
}
