Everyone Ought to Have a Friend
Python 2, 0 (350 344 314 309 301 298 291 bytes)



def f(tt):11
def f(tt):
 tt=tt.split('\n')
 r =0#.split('\n')
#r  0#
#for
 for  ii,ll in enumerate(tt):
  for jj,cc in enumerate(ll):
##for+=1-(
    r+=1-(cc in ll[(jj or 2)-1:jj+2:2]    +''.join(ll[jj:
 jj+1]for ll in tt[(ii or 2)-1:ii+2:2]))##+''.join(ll[jj:
#  +1]for&#32;
#print r
 print r
&#32;


Try it online!

-7 bytes, thanks to Jo King