check the picture below.
so notice, the sides AB and AC you can pretty much count them off the grid.
now, to get the CB side.
[tex]\bf \textit{distance between 2 points}\\ \quad \\
\begin{array}{lllll}
&x_1&y_1&x_2&y_2\\
% (a,b)
C&({{ -5}}\quad ,&{{ 1}})\quad
% (c,d)
B&({{ 3}}\quad ,&{{ -5}})
\end{array}\qquad
% distance value
d = \sqrt{({{ x_2}}-{{ x_1}})^2 + ({{ y_2}}-{{ y_1}})^2}
\\\\\\
CB=\sqrt{[3-(-5)]^2+[-5-1]^2}\implies CB=\sqrt{(3+5)^2+(-5-1)^2}
\\\\\\
CB=\sqrt{8^2+(-6)^2}\implies CB=\sqrt{100}\implies CB=10[/tex]
sum all three sides up, and that's the perimeter of the triangle.