Due to the conservation of charge, the total number of charges remain constant. The initial charge is +5q+(-1)q+0=4q, so the system end up with 4q. When sphere a and b touch, their charge become equal, so each takes on a charge of (+5-1)/2=2q. The a and c touch each other and evenly divide the total charge, each takes on a charge of 2/2=1q. Lastly, b and c touch each other, each has (2+1)/2=1.5q.