We are looking for the P(only A occurred | (only A occurred) or (only B occurred)).
In other words we want P(A and not B | (A and not B) or (B and not A)).
In other words, P(A and not B | (A or B) - (A and B)).
With Venn diagrams it looks really simple.
So we get (0.2-0.05) / (0.4-0.05) = 0.15/0.35 = 3/7.