# [R], <s>117</s> 63 bytes

<!-- language-all: lang-r -->

    function(m)sum(colSums(as.matrix(dist(which(m==8,T)))<=2^.5)<2)

[Try it online!][TIO-joeksn9c]

[R]: https://www.r-project.org/
[TIO-joeksn9c]: https://tio.run/##hVJNb5wwFLzzK57oxVa9aexdZ0Fajr1XaXrabKuEsoDEl7BRWLX97Vv72SZtg1QJkP2eZ97MmPH6Dj5ddNV3G6UvTQF1N0wadA/30D7psZ6jYchLMcJhA@epy3Xdd2Sm8CMCmG2xVNMziSFmccxmaqrdt7F/UbbVFF2pK0XGojRceVUoMjMozbaYh5HEj4/HmMFMKYUNcITmfYNQ8j8sC8j3wCl88FMtx9Qig9Kj7msydU2tNDE7NTS1Jk5u/tPMNu/JsMTIxKwDw2cYnG9iiZjnZV4ag@eL2UMGD/dfPtLoVxSds@uSS0vV1BJz8LPBkid146m@WwkvVZ1XpM2yhD2YQYdMfL2R9CDo9UxcxiQ@HhMGOwaSwZ35nhgcUwZbBq6c2MIt7kyb@xNmuWeQYlnYQoLLPULE6WRsRf@MQCJhmN92Jc7b@QNylUHiACtrhR01ooy3TSsIsdLzOxuJVy3xWcdJtOOi4H95Feh1HzTZwHxwSSg7sPCTHNstFnhIM7Ud/sec5Rr4msm1VGUQdxdG772QNPgWi1AfgLvYFMtb1/cYEcocF1aLv@3F2db9BD4Kd27BJK8hbYMVJ2@HR@SqB/76c0ivJcGsXArX3w "R – Try It Online"

<!-- language-all: lang-r -->

    function(m,p=which(m==8,T))sum(sapply(split(p,1:nrow(p)),function(y)sum(apply(p,1,function(x)all((c(y-x)^2<2)))))==1)

[Try it online!][TIO-joei6xun]

[R]: https://www.r-project.org/
[TIO-joei6xun]: https://tio.run/##hVLBbptAEL3zFSNy2VXHanZtYqjCsfcqSk@OWzkIAxIGxC4KqO23u7uzC0kbpFi2xc7Me/PeW/rrDXybdNk2G6WnOoeq6QYNuoUHuJx0X41B12WF7OF@A@ehyXTVNmzk8CsAGG2xUMMzCyHEMMSRm2rzs29flG3VeVPoUrE@LwxXVuaKjQiFOeZj17Pw6ekQIoycc9iAIGjW1gRlH2FxRn4CweGz32o5hgsxKN3rtmJDU1dKM3NSXV1p5uRmv81u8zsalpCY0DowfIbB@WaWCD0vemkIz5M5QwqPD9@/8uBPEJzT65LLBbv0payykl3SNMZHztVwYerUdfXE3P4OxZfGULCOc1yAEw26OTOBb5I@1TVjGZs2I/8h7yW3nzQV/Hpm7mZYeDjECDuECOHO/B8RDgnCFsGVY1u4pZNpCz9hHvcICZWlLcT0uCeIPB5NGMF/K4hIGub33Yj27fxAtMoQ0QIra4WdNJKM900riLCR53c2Yq86ou86LiI7Lgrxj1dJXvezJhuYDy6eyw4s/SbHdksFMaeZ2I54s2e5BrFmci3VaBZ3N6/eeyHJ7FsuQn0A7mITKm9d32PkXBb0YLX4216cbd1L4KNwcwsmfg1pO1tx8nY0Eq16EK8vR@S1xJSVS@H6Fw "R – Try It Online"