The perimeter of $\triangle ABC$ is $32.$ If $\angle ABC=\angle ACB$ and $BC=12,$ what is the length of $AB?$

[asy]
draw((0,0)--(12,0)--(6,10)--cycle,black+linewidth(1));
MarkAngle((12,0),(0,0),(6,10),1,black+linewidth(1));
MarkAngle((6,10),(12,0),(0,0),1,black+linewidth(1));
label("$A$",(6,10),N);
label("$B$",(0,0),W);
label("$C$",(12,0),E);
label("12",(0,0)--(12,0),S);
[/asy]
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
The perimeter of $\triangle ABC$ is $32.$ If $\angle ABC=\angle ACB$ and $BC=12,$ what is the length of $AB?$

[asy]
draw((0,0)--(12,0)--(6,10)--cycle,black+linewidth(1));
MarkAngle((12,0),(0,0),(6,10),1,black+linewidth(1));
MarkAngle((6,10),(12,0),(0,0),1,black+linewidth(1));
label("$A$",(6,10),N);
label("$B$",(0,0),W);
label("$C$",(12,0),E);
label("12",(0,0)--(12,0),S);
[/asy]
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
10
The perimeter of $\triangle ABC$ is $32.$ If $\angle ABC=\angle ACB$ and $BC=12,$ what is the length of $AB?$

[asy]
draw((0,0)--(12,0)--(6,10)--cycle,black+linewidth(1));
MarkAngle((12,0),(0,0),(6,10),1,black+linewidth(1));
MarkAngle((6,10),(12,0),(0,0),1,black+linewidth(1));
label("$A$",(6,10),N);
label("$B$",(0,0),W);
label("$C$",(12,0),E);
label("12",(0,0)--(12,0),S);
[/asy]
train