There were 20 - 5 = <<20-5=15>>15 units of non-defective smartphones.
There were 3 + 7 = <<3+7=10>>10 units sold to customers A and C.
So, 15 - 10 = <<15-10=5>>5 units were sold to customer B.
#### 5