import java.util.Scanner;

public class StdDev
{
   public static void main (String [] arg )
   {
      double[] numbers;       // list of numbers to process
      int      howMany;       // how many numbers we have
      Scanner  stringProc;    // will process the args
      Scanner  stdIn;         // standard input
      double   mean;          // mean
      double   stdDev;        // stdDev
      
      howMany = 25;
      //-------------------------------------------------------------
      // if input arguments, use for the length, otherwise 25
      //-------------------------------------------------------------
      if (arg.length > 0)     
      {
         stringProc = new Scanner(arg[0]);
         if (stringProc.hasNextInt())
         {
            howMany = stringProc.nextInt();
         }
      }
      
      numbers = new double[howMany];
      stdIn = new Scanner(System.in);
      
      //------------------------------------------------------------
      // read in all of the numbers
      //------------------------------------------------------------
      for (int ii = 0; ii < numbers.length; ii++)
      {
			if (stdIn.hasNextDouble())
   	      numbers[ii] = stdIn.nextDouble();
			else
			{
				stdIn.nextLine();  // throw bad value away
				ii--;
			}
      }

      //------------------------------------------------------------
      // calculate the mean
      //------------------------------------------------------------
      mean = StdDevHelper.mean(numbers);

      //------------------------------------------------------------
      // calculate the standard deviation - sum used for sum squares
      //------------------------------------------------------------
		stdDev = StdDevHelper.stdDev(numbers);
		    
      //------------------------------------------------------------
      // print the mean and standard deviation
      //------------------------------------------------------------
      
      System.out.printf("Mean: %.2f\n", mean);
      System.out.printf("Standard Deviation: %.2f\n", stdDev);
   }
}
         
       
