#include<stdio.h>
int main()
{
int n,m,i,a,b,c,d,e,f,sum,sum2;
while(scanf("%d",&n)!=EOF && n!=0)
{
sum2=0;
for(i=0;i<n;i++)
{
sum=0;
scanf("%d",&m);
a=m/100,b=(m-a*100)/50,c=(m-a*100-b*50)/10,d=(m-a*100-b*50-c*10)/5,e=(m-a*100-b*50-c*10-d*5)/2,f=m-a*100-b*50-c*10-d*5-e*2;
sum=a+b+c+d+e+f;
sum2+=sum;
}
printf("%d\n",sum2);
}
}