Answer: B

Call the number of residential buildings r and the number of commercial buildings c. Initially, the ratio is r/c = 2/3.

If three of the residential buildings are converted to commercial buildings, the number of residential buildings changes to r - 3, and the number of commercial buildings changes to c + 3. Since the new ratio is 3 to 5, the result is (r - 3)/(c + 3) = 3/5. We now have two equations with two variables; all that's left is to solve for r and c.

To do so, solve for r in the first equation:
r/c = 2/3
3r = 2c
r = (2c)/3

Plug that in to the second equation:
(r - 3)/(c + 3) = 3/5
((2c/3) - 3)/(c + 3) = 3/5

Cross-multiply:
5((2c/3) - 3) = 3(c + 3)
10c/3 - 15 = 3c + 9

Multiply everything by 3 to clear the fraction:
10c - 45 = 9c + 27
c = 72

Given the value of c, we can plug it back into the initial ratio to find the value of r:
r/c = 2/3
r/72 = 2/3
r = 144/3 = 48

For the total, we need r + c = 48 + 72 = 120, choice (B).