Sometimes there are members that do not belong to either set A or B.In that case the total number of members=Size A+Size B-Number of common members+Number of members not in A or B.
In an office, 35 people drink coffee, 27 drink tea, 12 drink both, and 4 drink neither. The total number of people in the office = 35+27-12+4=54.
In a class of 40 students, 20 study algebra, 15 study geometry, 8 study both.The total number of students that do not study either=40-(20+15-8)=13.
This is a relation between five numbers, and any one can be calculated given the other four.