5. To build a building, if construction teams A and B work together, the completion time is 40 days less than if team A builds it alone; if the first 3 floors are built by team A alone, and then team B joins, the completion time is 30 days less than if team A builds it alone. This building has $\qquad$ floors.
(A and B construction teams have constant building speeds)
$12$