#include <bits/stdc++.h>
using namespace std;
template <class P, class Q>
inline void smin(P &a, Q b) {
  if (b < a) a = b;
}
template <class P, class Q>
inline void smax(P &a, Q b) {
  if (a < b) a = b;
}
const int maxn = 300000 + 100;
int n;
int a[maxn], s[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 0, i__n = (int)(n); i < i__n; ++i)
    cin >> a[i], s[i + 1] = s[i] + a[i];
  int f = s[n] / 11 / 100;
  int pos = lower_bound(s, s + n + 1, f * 1000) - s;
  if (s[pos] > f * 1000 && pos == n) f--;
  cout << s[n] - f * 100 << endl;
  return 0;
}
