Count number of inversion using merge sort