#include<bits/stdc++.h>usingnamespace std;intmain(){int n;
cin >> n;int n_valid =0;double sum =0;for(int i =0; i < n;++i){
string tmp;
cin >> tmp;bool flag =true;try{int start =-1;int cnt =0;int len = tmp.length();int pos;while((pos=tmp.find('.', start +1))!= tmp.npos){++cnt;
start = pos;}if(cnt >1)throwexception();if(cnt && len - start -1>2){throwexception();}double d =stod(tmp);if(d >1000|| d <-1000){throwexception();}
sum += d;++n_valid;}catch(exception & e){
flag =false;}if(! flag){printf("ERROR: %s is not a legal number\n", tmp.c_str());}}if(n_valid ==0)printf("The average of 0 numbers is Undefined\n");elseif(n_valid >1)printf("The average of %d numbers is %.2f\n", n_valid, sum / n_valid);else{printf("The average of 1 number is %.2f\n", sum);}}