Usually the way that they achieve this without breaching the rules are by including promos for upcoming shows (which aren't classified as adverts) and by having fewer ads in the programs immediately preceding or following the popular US show. That way while there might be more than 12 minutes of adverts between 9pm and 10pm there are only 12 minutes in 8:30pm to 9:30pm and in 9:30pm to 10:30pm.American TV shows are often 40-45 minutes in length and are always in hour long slots.
American cartoons likewise are usually 20 minutes long, but take a full half hour slot up on the TV planner.
It appears these rules are totally ignored sadly.