import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = Integer.parseInt(sc.next()); List A = new ArrayList<>(); int sum = 0; for (int i = 0; i < N; i++) { A.add(Integer.parseInt(sc.next())); sum += A.get(i); } int K = 0; int T = 0; for (int i = 0; i < A.size(); i++) { List tmpList = new ArrayList<>(A); tmpList.remove(i); int tmp = calcSum(tmpList); if (sum - tmp == 2) K++; if (sum - tmp == 4) T++; } System.out.printf("%d %d\n", T, K); } private static int calcSum(List L) { final int[] sum = {0}; L.forEach(integer -> sum[0] += integer); return sum[0]; } }