import java.util.*; public class Main{ public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int data, i, a = 0, b = 0, c = 0; int [] A = new int[n]; int [] B = new int[n]; for(i = 0; i < n; i++) { data = scan.nextInt(); A[i] = data; } B = A.clone(); Arrays.sort(B); for(i = 0; i < n; i++) { if(A[i] > B[i]) a++; else if(A[i] == B[i]) b++; else c++; } System.out.println(a+"\n"+b+"\n"+c); scan.close(); } }