import java.util.Scanner;
import java.util.regex.Pattern;
class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int count = sc.nextInt();
float sum = 0;//计算符合条件的额总数和
int zong = 0;//计算符合条件的个数
for(int i = 0;i<count;i++){
String a = sc.next();
String rex = "([\\+ \\-]?(([1-9]\\d*)|(0)))([.]\\d{0,2})?";
if(a.matches(rex)){
//是数字
float b = Float.parseFloat(a);
if((b>=-1000)&&(b<=1000)){
//没有超过范围
String str = b+"";
int num = str.length()-(str.indexOf(".")+1);
if(num<=2){
//没有超过两位小数
zong++;
sum+=b;
}else{
//输出超出两位小数不是一个有效数字
System.out.println("ERROR: "+a+" is not a legal number");
}
}else{
//输出超出范围不是一个有效数字
System.out.println("ERROR: "+a+" is not a legal number");
}
}else{
//输出字母不是一个有效的数字
System.out.println("ERROR: "+a+" is not a legal number");
}
}
if(zong!=0){
float ave = sum/zong;
System.out.print("The average of "+zong+" numbers is ");
System.out.printf("%.2f",ave);
System.out.println();
}else{
System.out.println("The average of 0 numbers is Undefined");
}
}
}