// Compute average of a list of positive numbers 	
	
import java.io.*;	
	
public class NumberAverage {	
	// main(): application entry point	
	public static void main(String[] args) throws IOException {	
		// set up the list processing	
		BufferedReader stdin = new BufferedReader(	
				new InputStreamReader( System.in ) );	
	
		int valuesProcessed = 0;   // no values processed so far	
		double valueSum = 0;       // running total	
	
		// prompt user for values	
		System.out.println("Enter positive numbers one per line.  "	
		  + "Indicate the end of the\nlist with a negative number.");	
	
		// get first value	
		double value = Double.parseDouble(stdin.readLine());	
	
		// process values one-by-one	
		while (value >= 0) {	
			// add value to running total	
			valueSum += value;	
			// processed another value	
			++valuesProcessed;	
			// prepare for next iteration --- get next value	
			value = Double.parseDouble(stdin.readLine());	
		}	
	
		// display result	
		if (valuesProcessed > 0) {	
			// compute and display average	
			double average = valueSum / valuesProcessed;	
			System.out.println("Average: " + average);	
		}	
		else {	
			System.out.println("No list to average");	
		}	
	}	
}	
	
