import numpy as np
H ,W = map(int,input().split())

maze = [[] for _ in range(H)]
for i in range(H):
    maze[i] = np.array(list(input())) == "."
maze = np.array(maze)

up = np.zeros((H, W), dtype=int)
down = np.zeros((H, W), dtype=int)
right = np.zeros((H, W), dtype=int)
left = np.zeros((H, W), dtype=int)

for i in range(H):
    up[i] = (up[i-1] + 1)*maze[i]
    down[-(i+1)] = (down[-i] + 1)*maze[-(i+1)] 
    
#print(up)
#print(down)

for i in range(W):
    right[:, i] = (right[:, i-1] + 1)*maze[:, i]
    left[:, -(i+1)] = (left[:, -i] + 1)*maze[:, -(i+1)]

print(np.max(up+down+right+left)-3) import numpy as np numpy H ,W = map(int,input().split()) H map(int,input().split()) map int input().split() ().split () input split W [] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [] maze = [[] for _ in range(H)] maze [[] for _ in range(H)] for i in range(H):
    maze[i] = np.array(list(input())) == "." i range(H) range H maze[i] = np.array(list(input())) == "." maze[i] maze i np.array(list(input())) == "." np.array(list(input())) np.array np array list(input()) list input() input "." maze = np.array(maze) maze np.array(maze) np.array np array maze up = np.zeros((H, W), dtype=int) up np.zeros((H, W), dtype=int) np.zeros np zeros (H, W) H W dtype=int dtype int down = np.zeros((H, W), dtype=int) down np.zeros((H, W), dtype=int) np.zeros np zeros (H, W) H W dtype=int dtype int right = np.zeros((H, W), dtype=int) right np.zeros((H, W), dtype=int) np.zeros np zeros (H, W) H W dtype=int dtype int left = np.zeros((H, W), dtype=int) left np.zeros((H, W), dtype=int) np.zeros np zeros (H, W) H W dtype=int dtype int for i in range(H):
    up[i] = (up[i-1] + 1)*maze[i]
    down[-(i+1)] = (down[-i] + 1)*maze[-(i+1)] 
    
#print(up)
#print(down) i range(H) range H up[i] = (up[i-1] + 1)*maze[i] up[i] up i (up[i-1] + 1)*maze[i] up[i-1] + 1 up[i-1] up i-1 i 1 1 maze[i] maze i down[-(i+1)] = (down[-i] + 1)*maze[-(i+1)] down[-(i+1)] down -(i+1) i+1 i 1 (down[-i] + 1)*maze[-(i+1)] down[-i] + 1 down[-i] down -i i 1 maze[-(i+1)] maze -(i+1) i+1 i 1 for i in range(W):
    right[:, i] = (right[:, i-1] + 1)*maze[:, i]
    left[:, -(i+1)] = (left[:, -i] + 1)*maze[:, -(i+1)] i range(W) range W right[:, i] = (right[:, i-1] + 1)*maze[:, i] right[:, i] right : (right[:, i-1] + 1)*maze[:, i] right[:, i-1] + 1 right[:, i-1] right : 1 maze[:, i] maze : left[:, -(i+1)] = (left[:, -i] + 1)*maze[:, -(i+1)] left[:, -(i+1)] left : (left[:, -i] + 1)*maze[:, -(i+1)] left[:, -i] + 1 left[:, -i] left : 1 maze[:, -(i+1)] maze : print(np.max(up+down+right+left)-3) print np.max(up+down+right+left)-3 np.max(up+down+right+left) np.max np max up+down+right+left up+down+right up+down up down right left 3 maze = [[] for _ in range(H)] [[] for _ in range(H)] maze down = np.zeros((H, W), dtype=int) np.zeros((H, W), dtype=int) down maze = np.array(maze) np.array(maze) maze right = np.zeros((H, W), dtype=int) np.zeros((H, W), dtype=int) right up = np.zeros((H, W), dtype=int) np.zeros((H, W), dtype=int) up W = map(int,input().split()) map(int,input().split()) W H ,W = map(int,input().split()) map(int,input().split()) H left = np.zeros((H, W), dtype=int) np.zeros((H, W), dtype=int) left
import numpy as np
H ,W = map(int,input().split())

maze = [[] for _ in range(H)]
for i in range(H):
    maze[i] = np.array(list(input())) == "."
maze = np.array(maze)

up = np.zeros((H, W), dtype=int)
down = np.zeros((H, W), dtype=int)
right = np.zeros((H, W), dtype=int)
left = np.zeros((H, W), dtype=int)

for i in range(H):
    up[i] = (up[i-1] + 1)*maze[i]
    down[-(i+1)] = (down[-i] + 1)*maze[-(i+1)] 
    
#print(up)
#print(down)

for i in range(W):
    right[:, i] = (right[:, i-1] + 1)*maze[:, i]
    left[:, -(i+1)] = (left[:, -i] + 1)*maze[:, -(i+1)]

print(np.max(up+down+right+left)-3)
