That is merely a cartesian plot of the points, not raster cells.
The x and y axis show spacings of 1 unit for distance, so for a horizontal or vertical movement you are moving 1 distance unit. a diagonal movement would represent sqrt(2) (pythagorean theorem).
You must decide which points to include given that the distance values must be <= 2.
Pick the points to include and use the equation to sum the distance values etc...
Since it is a problem presumably for a course, I will leave the solution to you... make sure you show your work.