#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int f[] = {100, 50, 10, 5, 2, 1};
int n;
int main()
{
while (cin >> n && n)
{
int ans = 0;
while (n -- )
{
int x;
cin >> x;
for (int i = 0; i < 6; i ++ )
ans += x / f[i], x %= f[i];
}
cout << ans << endl;
}
return 0;
}