import sys input = sys.stdin.readline N=int(input()) MAP=[list(input().strip()) for i in range(N)] flag=1 for i in range(N): if MAP[0][i]=="#": flag=0 if MAP[0][N-1]=="#": flag=0 if MAP[i][0]=="#": flag=0 if MAP[N-1][0]=="#": flag=0 if flag==1: ANS=4 else: ANS=0 for i in range(N): if not ("#" in MAP[i][0:N-1]): for j in range(N-1): MAP[i][j]="#" score=1 for j in range(N): x=0 for i in range(N): if MAP[i][j]==".": x+=1 if x>=N-1: score+=1 break ANS=max(ANS,score) for j in range(N-1): MAP[i][j]="." if not ("#" in MAP[i][1:N]): for j in range(1,N): MAP[i][j]="#" score=1 for j in range(N): x=0 for i in range(N): if MAP[i][j]==".": x+=1 if x>=N-1: score+=1 break ANS=max(ANS,score) for j in range(1,N): MAP[i][j]="." MAP2=[["."]*N for i in range(N)] for i in range(N): for j in range(N): if MAP[i][j]=="#": MAP2[N-1-j][i]="#" MAP=MAP2 for i in range(N): if not ("#" in MAP[i][0:N-1]): for j in range(N-1): MAP[i][j]="#" score=1 for j in range(N): x=0 for i in range(N): if MAP[i][j]==".": x+=1 if x>=N-1: score+=1 break ANS=max(ANS,score) for j in range(N-1): MAP[i][j]="." if not ("#" in MAP[i][1:N]): for j in range(1,N): MAP[i][j]="#" score=1 for j in range(N): x=0 for i in range(N): if MAP[i][j]==".": x+=1 if x>=N-1: score+=1 break ANS=max(ANS,score) for j in range(1,N): MAP[i][j]="." print(ANS)