import java.util.Scanner;
public class Main {
public static void main(String[] args) { // hlavná metódu, spustí sa pri spustení programu
Scanner sc = new Scanner(System.in); // vytvorenie Scanera, teda to, čo bude načitávať vstup
/* premenné */
int sucet = 0;
int input;
int i;
/* ------- */
for (i = 0;;i++) { // cyklus, počíta iterácie
input = Integer.parseInt( sc.nextLine() ); // načítanie vstupu a prevedenie na číslo
if (input == 0) break; // podmienka pre nulu, kedy ukončíme cyklus
sucet += input; // pričítanie čísla ku vstupu
}
System.out.println(sucet); // vypísanie súčtu
System.out.println(sucet/i); // vypísanie súčtu deleno počet iterácií (čísel) = priemer.
}
}