I've tried it like this- From sine law we have $a=2R\sin{A}$, $b=2R\sin{B}$, $c=2R\sin{C}$.
So, $p=R^2[(2\sin{A}-1)^2 + (2\sin{B}-1)^2 + (2\sin{C}-1)^2]$
$=R^2[4(\sin^2{A} + \sin^2{B} + \sin^2{C}) + 3 - 4(\sin{A} + \sin{B} + \sin{C})]$
$=R^2[4(\sin^2{A} + \sin^2{B} + \sin^2(A+B)) + 3 - 4(\sin{A} + \sin{B} + \sin(A+B))]$
$=R^2[4(\sin^2{A} + \sin^2{B} + (\sin{A}\cos{B} + \cos{A}\sin{B})^2) + 3 - 4(\sin{A} + \sin{B} + \sin{A}\cos{B} + \cos{A}\sin{B})]$
Now I'm stuck and couldn't proceed. Can you kindly help?