1,376. How Many Days to Observe
220:8 If a person observed mourning before Pesach - even for an hour or less - this is considered like the entire week of shiva. The eight days of Pesach bring him up to day 15, so the mourner must observe another 15 days to complete shloshim. If he observed an hour or less of mourning before Shavuos, that's considered like the week of shiva; the first day of Shavuos is considered like another seven days since one's sacrifice for the holiday could be brought the entire week. The second day of Shavuos is therefore like the fifteenth day of mourning, so the mourner must observe another 15 days to complete shloshim. If one observed mourning an hour or less before Succos, this is like the week of shiva. The seven days of Succos bring it up to 14 days. Shemini Atzeres is considered like another seven days since it's a separate yom tov whose sacrifice can be made up (as in the case of Shavuos). This makes 21 days; plus Simchas Torah makes 22, so the mourner needs only add eight more days to complete shloshim.
220:9 Rosh Hashana and Yom Kippur are also holidays that cancel the restrictions of shiva and shloshim. If one observed even a little mourning before Rosh Hashana, then Rosh Hashana cancels the shiva and Yom Kippur cancels shloshim. If he observed even a little mourning before Yom Kippur, then Yom Kippur cancels shiva and Succos cancels shloshim.