I got 25

number 3 can only be in 3rd , 4th or 5th positions as it must be preceeded and suceeded by 2 numbers.

Now if it is in 3rd place -> it can be preceeded in 2! ways and succeded in 4! ways. So total = 48. Exactly the reverse argument holds when 3 is in 5th place. So again there are 48 cases.

When 3 is in 4th place .. there are 3 places before and 3 after. in the 3 places before 1 and 2 must be there.. so we need to do 3P2 = 6. similarly, in the 3 places after 3 we can do 3P2 for finding correct places of 6 and 7.. so we have 6*6=36 ways so far and in addition the 2 empty places can be filled by 4 or 5.. so 36*2=72

now 48 + 48 + 72=168

I hope this helps someone :D