The +1's are to make up for the fact that the 2^5 terms double-count words AAAAA, BBBBB, and CCCCC. There are 2^5 ways to make up words using only A and B, including AAAAA and BBBBB. There are also 2^5 ways to make up words using only A and C, including AAAAA and CCCCC. And there are 2^5 ways to make up words using only B and C, including BBBBB and CCCCC. By subtracting 2^5 three times you have eliminated the possibility of AAAAA, BBBBB and CCCC twice each, so you need to add 3 to get the correct answer.