import java.util.*;
class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
int n = sc.nextInt();
if(n==0){
return;
}
int sum=0,x;
for(int i=0; i<n; i++){
x = sc.nextInt();
sum += count(x);
}
System.out.println(sum);
}
}
public static int count(int a){
int c = 0;
while(a>0){
if(a>=100){
a -=100;
c++;
}else if(a>=50){
a -=50;
c++;
}else if(a>=10){
a -=10;
c++;
}else if(a>=5){
a -=5;
c++;
}else if(a>=2){
a -=2;
c++;
}else{
a -=1;
c++;
}
}
return c;
}
}
import java.util.*;
public class Main {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
int m = sc.nextInt();
int n = sc.nextInt();
int x=0,y=0,s=0,val;
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
val=sc.nextInt();
if(abs(val)>abs(s)){
s=val;
x=i;
y=j;
}
}
}
System.out.println((x+1)+" "+(y+1)+" "+s);
}
}
private static int abs(int n) {
if(n<0){
return -n;
}
return n;
}
}
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while(in.hasNext()){
int n = in.nextInt();
int m = in.nextInt();
int[][] s = new int[n][m];
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
s[i][j]=in.nextInt();
}
}
double[] avgStu = new double[n];
for(int i=0;i<n;i++){
double sum1=0.0;
for(int j=0;j<m;j++){
sum1 = sum1+s[i][j];
}
avgStu[i] = sum1/m;
System.out.printf("%.2f", avgStu[i]);
if(i<n-1){
System.out.print(" ");
}else{
System.out.println();
}
}
double avgCourse[] = new double[m];
for(int i=0;i<m;i++){
double sum2=0.0;
for(int j=0;j<n;j++){
sum2 = sum2+s[j][i];
}
avgCourse[i]=sum2/n;
System.out.printf("%.2f",avgCourse[i]);
if(i<m-1){
System.out.print(" ");
}else{
System.out.println();
}
}
int num=0;
for(int i=0;i<n;i++){
int count = 0;
for(int j=0;j<m;j++){
if(s[i][j]>=avgCourse[j]){
count++;
}
}
if(count==m){
num++;
}
}
System.out.println(num);
System.out.println();
}
}
}