import java.io.*; 
  
public class ListFile 
{ 
  public static void main(String[] argv) throws Exception 
  { 
    BufferedReader fin; 
    fin = new BufferedReader(new FileReader("many.txt")); 
  
    // create an empty list of capacity 100 
    int nScores = 0; 
    int[] score = new int[100]; 
  
    // read and save the scores 
    while (fin.ready()) 
    { 
      // read a score from the file 
      int aScore; 
      aScore = new Double(fin.readLine()).intValue(); 
  
      // add score to list, if it's not full 
      if (nScores < score.length) 
        score[nScores++] = aScore; 
    } // while 
    fin.close(); 
  
    // find the average 
    int i; // loop counter 
    int scoreTotal = 0; 
    for (i = 0; i < nScores; i++) 
      scoreTotal += score[i]; 
    double average = (double)scoreTotal / nScores; 
    System.out.println("The average of " + nScores 
      + " numbers is " + average); 
  
    // count scores > average 
    int nGreater = 0; 
    for (i = 0; i < nScores; i++) 
      if (score[i] > average) nGreater++; 
    System.out.println("" + nGreater 
      + " scores are greater than the average."); 
  } // main 
} // public class 
