22
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000
 2
1000 2000
 19
2000 2000 1000 2000 2000 2000 2000 2000 2000 2000 2000 1000 2000 2000 2000 1000 1000 1000 2000
 20
2000 1000 2000 2000 2000 2000 2000 2000 2000 2000 1000 2000 2000 2000 1000 1000 2000 1000 1000 2000
 1
1000
 60
1000 1000 1000 2000 1000 1000 1000 2000 2000 2000 2000 1000 2000 1000 2000 1000 1000 1000 2000 2000 2000 1000 2000 1000 2000 1000 2000 2000 2000 1000 2000 2000 2000 1000 1000 2000 1000 1000 1000 2000 1000 2000 2000 2000 1000 1000 2000 1000 1000 2000 2000 1000 1000 1000 2000 2000 1000 2000 1000 2000
 57
1000 2000 2000 1000 2000 2000 1000 1000 2000 2000 1000 2000 2000 2000 2000 2000 1000 1000 2000 2000 2000 1000 1000 1000 1000 2000 2000 1000 1000 2000 1000 1000 2000 1000 1000 1000 1000 2000 2000 2000 2000 2000 2000 1000 1000 2000 2000 1000 1000 1000 1000 2000 1000 2000 2000 2000 2000
 24
2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 1000 1000
 20
2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000
 13
2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 1000 1000
 46
1000 2000 2000 2000 2000 2000 2000 1000 2000 1000 1000 1000 1000 1000 2000 2000 1000 1000 2000 2000 1000 2000 2000 1000 2000 2000 1000 2000 1000 1000 2000 1000 1000 2000 1000 2000 1000 1000 1000 2000 2000 1000 1000 1000 2000 1000
 20
2000 2000 2000 2000 2000 2000 2000 2000 2000 1000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000
 11
2000 2000 2000 1000 1000 1000 1000 2000 2000 2000 2000
 6
1000 2000 2000 2000 1000 2000
 2
1000 1000
 12
2000 2000 2000 2000 2000 2000 1000 2000 2000 2000 2000 1000
 8
2000 1000 2000 1000 2000 2000 2000 1000
 12
2000 2000 2000 2000 2000 1000 2000 2000 2000 2000 2000 1000
 34
2000 1000 2000 2000 1000 1000 1000 2000 2000 1000 2000 2000 1000 1000 2000 2000 1000 1000 2000 2000 1000 1000 1000 2000 1000 1000 2000 2000 2000 2000 1000 1000 2000 2000
 10
2000 1000 2000 2000 2000 2000 2000 2000 1000 2000
 4
1000 1000 1000 1000
 12
2000 2000 2000 2000 2000 2000 2000 2000 2000 1000 2000 1000
 1
2000
 12
1000 1000 2000 1000 2000 1000 1000 1000 1000 1000 2000 1000
 8
2000 2000 1000 1000 1000 2000 1000 1000
 15
2000 2000 1000 2000 2000 1000 1000 2000 2000 1000 2000 2000 2000 2000 2000
 17
2000 2000 2000 2000 2000 1000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000
 16
2000 1000 2000 2000 1000 1000 2000 1000 2000 2000 1000 1000 1000 1000 2000 1000
 20
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
 20
1000 1000 1000 2000 2000 2000 2000 2000 1000 1000 1000 2000 2000 2000 2000 2000 1000 1000 1000 2000
 8
2000 2000 2000 2000 2000 1000 2000 1000
 17
1000 1000 2000 1000 1000 1000 2000 2000 1000 1000 2000 1000 2000 2000 2000 1000 1000
 8
1000 1000 2000 2000 2000 2000 2000 1000
 7
2000 2000 2000 2000 1000 1000 1000
 18
2000 1000 1000 2000 1000 2000 1000 2000 1000 1000 1000 2000 1000 1000 1000 1000 2000 2000
 8
2000 1000 1000 1000 2000 1000 1000 2000
 37
1000 2000 2000 1000 2000 2000 1000 1000 2000 1000 1000 2000 1000 2000 1000 1000 2000 2000 1000 2000 1000 1000 2000 1000 2000 2000 1000 1000 1000 2000 2000 2000 2000 2000 1000 2000 1000
 16
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 2000 1000
 17
2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 1000 2000
 70
1000 2000 2000 2000 1000 1000 2000 2000 2000 2000 2000 2000 2000 1000 1000 2000 2000 2000 2000 2000 1000 1000 1000 1000 1000 2000 2000 2000 2000 2000 2000 2000 2000 1000 2000 1000 1000 2000 1000 2000 1000 1000 2000 1000 1000 1000 2000 2000 1000 2000 2000 2000 1000 2000 1000 2000 2000 2000 2000 2000 2000 2000 2000 1000 2000 2000 2000 1000 2000 2000
 31
1000 2000 1000 2000 2000 2000 2000 2000 1000 1000 2000 1000 1000 1000 2000 2000 1000 1000 2000 1000 1000 1000 1000 2000 1000 2000 2000 1000 1000 1000 2000
 19
2000 2000 1000 2000 2000 2000 2000 2000 2000 2000 2000 1000 2000 2000 2000 1000 1000 2000 1000

30000 2900 30000 31000 1000 81900 80000 41900 36400 21900 61900 35500 16400 9200 1900 20000 11900 20000 47300 16400 3700 20000 2000 13700 10000 23700 30000 21000 18200 28200 12800 21900 11900 10000 22800 10100 51000 15500 30000 105500 41000 30000
#include <bits/stdc++.h>
using namespace std;
int n, tot, tmp, sum, a[5000005];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] == 1000)
      tot++, sum++;
    else
      sum += 2;
  }
  sort(a + 1, a + n + 1);
  reverse(a + 1, a + n + 1);
  int tmp = 10 * sum / 11;
  if (sum <= 11) tmp = sum - a[n] / 1000;
  if (!tot && tmp & 1) tmp--;
  printf("%d\n", 1000 * sum - tmp * 100);
  return 0;
}
