import java.util.stream.*;

public class AnalyzeNumbersUsingStream {
  public static void main(String[] args) {
    java.util.Scanner input = new java.util.Scanner(System.in);
    System.out.print("Podaj liczbę wartości: ");
    int n = input.nextInt();
    double[] numbers = new double[n];
    double sum = 0;

    System.out.print("Podaj wartości: ");
    for (int i = 0; i < n; i++) {
      numbers[i] = input.nextDouble();
    }

    double average = DoubleStream.of(numbers).average().getAsDouble();
    System.out.println("Średnia: " + average);
    System.out.println("Liczba wartości powyżej średniej: "
      + DoubleStream.of(numbers).filter(e -> e > average).count());
  }
}
