import java.util.Scanner; public class yukicoder_112 { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = stdIn.nextInt(); } int turu = 0; int kame = 0; for (int i = 0; i < a.length; i++) { if (a[i] == 2) { turu++; } else { kame++; } } System.out.println(turu + " " + kame); } }