import java.io.*;

/**
 * This program prompts the user to enter a bunch of decimal numbers
 * ....then it computes the average...
 * 
 * @author Qusay H. Mahmoud
 */

public class Sum {
  public static void main(String argv[]) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String s;
    double n=0.0;
    double counter=0;
    double sum = 0.0;
    do {
      System.out.print("Enter a mark: ");
      s = br.readLine();
      n = Double.parseDouble(s);
      if (n != -1) {
        sum = sum + n;
        counter++;
      }
    } while(n!=-1.0);
    System.out.println("The avg is: "+ sum/counter);
  }
}
