Read the following passage and solve the questions based on it.
Three men (Tom, Peter and Jack) and three women (Eliza, Anne and Karen) are spending a few months at a hillside. They are to stay in a row of nine houses, which are facing north, each one living in his or her own house. There are no others staying in the same row of houses. Following are the details given regarding each of their houses:
(i) Anne, Tom and Jack do not want to stay in any house, which is at the end of the row.
(ii) Eliza and Anne are unwilling to stay beside any occupied house.
(iii) When Karen, Peter and Jack stand facing north, Karen finds that houses of both Peter and Jack are on her left-hand side.
(iv) Between Anne and Jack’s house there is just one vacant house.
(v) None of the girls occupy adjacent houses.
(vi) The house occupied by Tom is next to the house at the end.
(vii) House of P is at one of the ends.
How many of them occupy houses next to a vacant house?