import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { BufferedReader buff = new BufferedReader(new InputStreamReader(System.in)); try { int count = Integer.parseInt(buff.readLine()); String[] box = buff.readLine().split(" "); int total = 0; int crane = 0, turtle = 0; for(int i = 0; i < count; ++i){ if(Integer.parseInt(box[i]) == 2){ crane++; }else{ turtle++; } } System.out.println(turtle + " " + crane); } catch (NumberFormatException e) { e.getStackTrace(); } catch (IOException e) { e.getStackTrace(); } catch (Exception e) { e.getStackTrace(); } } }