Grover Cleveland held the post of President of the United States of America on two separate occasions: 1885-1889 and 1893-1897. As he is the only President ever to serve two non-consecutive terms, he is considered to be both the 22nd and 24th President of the United States.
Thus, President George W. Bush Barack H. Obama is the 43rd 44th President, but only the 42nd 43rd person to hold that post.
Since a number of Prime Ministers of Canada (including John A. MacDonald, the first) have served non-consecutive terms, the number of Prime Ministers and the number of people who held that post remain identical.