#include<stdio.h>
int main(void){
  int i=0;
  int n=0;
  int s[20];
  int sum=0;
  int average;
  while(1){
    scanf("%d",&n);//?????°
    if(n=0) break;
    for(i=1;i<=n;i++)
      {	
	s[i]=s;
	scanf("%d",&s);//?????°
	printf("%d",s);
	if(s=1000&&s=0){
	}
	else if(s<1000&&0<s){
	  sum+=s;
      }
      }
    average=sum/n;
    printf("%d",average);
  }
  return 0;
}