I was going to post the numbers from the Cruise AnswerBook, but somebody else beat me to it. Be aware, though, that the number of formal nights may vary. When I went through the Panama Canal aboard MV Sun Princess last fall, we had three formal nights. So many passengers were members of the Captain's Circle that they had to have separate Captain's Circle gatherings for each dining room -- thus requiring the third formal night since the Captain's Circle Cocktail Party always happens on a formal night.
It's a good idea to be prepared for one extra formal night and one or two extra semiformal nights. An extra dress shirt and an extra necktie do not require a lot of space in your suitcase. In addition to changes in the number of formal and semiformal nights, I have occasionally encountered opportunities to attend special events that require business attire. Also, an invitation to dinner at the Captain's Table -- should you be fortunate enough to receive one -- requires semiformal attire if the evening is otherwise casual. Like a good boy scout, "Be prepared!"
You will get a package before your docs., about 60 days before sailing, containing two pamphlets: the 'Cruise Answer Book' - general info., and 'Adventures Ashore' - shore excursion info. It will also contain shore excursion booking sheets and immigration/ special diet request sheets etc. for you to fill out and fax back to Princess (or do online).
Just returned from a 10-day cruise on the Crown to the Panama Canal. We had 2 formal nights and 2 semi-formal nights. However, even if the book says that on the semi-formal nights mem should wear jackets, very few did and the women dressed rather casually (thank goodness!). I dress up for the formal nights, but on the semi-formal and casual nights I wear the same type of clothes.