H,W=map(int,input().split()) L=[list(input()) for _ in range(H)] dhw=[(1,1),(1,-1),(-1,1),(-1,-1)] P=[] for h in range(H): for w in range(W): if L[h][w]=="#": flag=1 for dh,dw in dhw: if not(0<=h+dh