Because items may be used repeatedly, this is an unbounded knapsack problem.
Let,
$DP[w]=$ maximum value possible with capacity $w$
For each capacity:
$DP[w]=\max_i\{value_i+DP[w-size_i]\}$
Now calculate.
Capacity $\mathbf{1}$
Only A fits:
$DP[1]=2$
Capacity $\mathbf{2}$
Options:
$A+A=4$
$B=6$
$\therefore DP[2]=6$
Capacity $\mathbf{3}$
Options include:
$A+A+A=6$
$A+B=8$
$C=9$
$\therefore DP[3]=9$
Capacity $\mathbf{4}$
Best choice:
$B+B$
Value:
$6+6=12$
$\therefore DP[4]=12$
Capacity $\mathbf{5}$
Possible optimal combinations include:
$B+C$
Weight:
$2+3=5$
Value:
$6+9=15$
$\therefore DP[5]=15$
Answer : $\boxed{15}$