According to Statement 1, B can only live on the 2nd or the 3rd floor (Statement 4 says that B does not live on 1st floor).
But if B lives on the 2nd floor and hence A on the 7th, is not possible to fit in the floors for D, F, H, C and E (see Statements 2 and 3).
Hence B and A must live on 3rd and 8th floor respectively.
H, C and E live on 3 adjacent floors, so they must live on floors between B and A.
Subsequently as D and F are also on adjacent floors, they must live on 1st and 2nd floor (not necessarily in that order).
Some of the possible distributions are:
It can be seen that D will live on either the 1 st or the 2nd floor.
Also, C’s floor would be one of 4th, 5th, 6th or 7th.
So the possible values of N: 6, 5, 4, 3, 2
Total possible values of N = 5