H,W=map(int,input().split()) MAP=[input().strip() for i in range(H)] for i in range(H): for j in range(W): S=[[0]*W for i in range(H)] flag=0 for k in range(H): if flag==1: break for l in range(W): if MAP[k][l]=="#" and S[k][l]==0: S[k][l]=1 if k+i