import sys
H, W = map(int, input().split())
G = [sys.stdin.readline() for _ in range(H)]

counts = [[[-1] * 4 for _ in range(W + 1)] for _ in range(H + 1)]
for h in range(H):
    for w in range(W):
        if G[h][w] == ".":
            counts[h][w][0] = counts[h][w-1][0] + 1
            counts[h][w][1] = counts[h-1][w][1] + 1
        dih = H - h - 1
        diw = W - w - 1
        if G[dih][diw] == ".":
            counts[dih][diw][2] = counts[dih][diw+1][2] + 1
            counts[dih][diw][3] = counts[dih+1][diw][3] + 1
ans = 0
for h in range(H):
    for w in range(W):
        if G[h][w] == ".":
            ans = max(ans, sum(counts[h][w]) + 1)
print(ans) import sys sys H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W sys.stdin.readline() for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline G = [sys.stdin.readline() for _ in range(H)] G [sys.stdin.readline() for _ in range(H)] [[-1] * 4 for _ in range(W + 1)] for _ in range(H + 1) for _ in range(H + 1) _ range(H + 1) range H + 1 H 1 for _ in range(H + 1) [[-1] * 4 for _ in range(W + 1)] counts = [[[-1] * 4 for _ in range(W + 1)] for _ in range(H + 1)] counts [[[-1] * 4 for _ in range(W + 1)] for _ in range(H + 1)] for h in range(H):
    for w in range(W):
        if G[h][w] == ".":
            counts[h][w][0] = counts[h][w-1][0] + 1
            counts[h][w][1] = counts[h-1][w][1] + 1
        dih = H - h - 1
        diw = W - w - 1
        if G[dih][diw] == ".":
            counts[dih][diw][2] = counts[dih][diw+1][2] + 1
            counts[dih][diw][3] = counts[dih+1][diw][3] + 1 h range(H) range H for w in range(W):
        if G[h][w] == ".":
            counts[h][w][0] = counts[h][w-1][0] + 1
            counts[h][w][1] = counts[h-1][w][1] + 1
        dih = H - h - 1
        diw = W - w - 1
        if G[dih][diw] == ".":
            counts[dih][diw][2] = counts[dih][diw+1][2] + 1
            counts[dih][diw][3] = counts[dih+1][diw][3] + 1 w range(W) range W if G[h][w] == ".":
            counts[h][w][0] = counts[h][w-1][0] + 1
            counts[h][w][1] = counts[h-1][w][1] + 1
         G[h][w] == "." G[h][w] [h] G h w "." counts[h][w][0] = counts[h][w-1][0] + 1 counts[h][w][0] [w] [h] counts h w 0 counts[h][w-1][0] + 1 counts[h][w-1][0] [w-1] [h] counts h w-1 w 1 0 1 counts[h][w][1] = counts[h-1][w][1] + 1 counts[h][w][1] [w] [h] counts h w 1 counts[h-1][w][1] + 1 counts[h-1][w][1] [w] [h-1] counts h-1 h 1 w 1 1 dih = H - h - 1 dih H - h - 1 H - h H h 1 diw = W - w - 1 diw W - w - 1 W - w W w 1 if G[dih][diw] == ".":
            counts[dih][diw][2] = counts[dih][diw+1][2] + 1
            counts[dih][diw][3] = counts[dih+1][diw][3] + 1 G[dih][diw] == "." G[dih][diw] [dih] G dih diw "." counts[dih][diw][2] = counts[dih][diw+1][2] + 1 counts[dih][diw][2] [diw] [dih] counts dih diw 2 counts[dih][diw+1][2] + 1 counts[dih][diw+1][2] [diw+1] [dih] counts dih diw+1 diw 1 2 1 counts[dih][diw][3] = counts[dih+1][diw][3] + 1 counts[dih][diw][3] [diw] [dih] counts dih diw 3 counts[dih+1][diw][3] + 1 counts[dih+1][diw][3] [diw] [dih+1] counts dih+1 dih 1 diw 3 1 ans = 0 ans 0 for h in range(H):
    for w in range(W):
        if G[h][w] == ".":
            ans = max(ans, sum(counts[h][w]) + 1) h range(H) range H for w in range(W):
        if G[h][w] == ".":
            ans = max(ans, sum(counts[h][w]) + 1) w range(W) range W if G[h][w] == ".":
            ans = max(ans, sum(counts[h][w]) + 1) G[h][w] == "." G[h][w] [h] G h w "." ans = max(ans, sum(counts[h][w]) + 1) ans max(ans, sum(counts[h][w]) + 1) max ans sum(counts[h][w]) + 1 sum(counts[h][w]) sum counts[h][w] [h] counts h w 1 print(ans) print ans H, W = map(int, input().split()) map(int, input().split()) H counts = [[[-1] * 4 for _ in range(W + 1)] for _ in range(H + 1)] [[[-1] * 4 for _ in range(W + 1)] for _ in range(H + 1)] counts dih = H - h - 1 H - h - 1 dih G = [sys.stdin.readline() for _ in range(H)] [sys.stdin.readline() for _ in range(H)] G diw = W - w - 1 W - w - 1 diw W = map(int, input().split()) map(int, input().split()) W ans = max(ans, sum(counts[h][w]) + 1) max(ans, sum(counts[h][w]) + 1) ans ans = 0 0 ans
import sys
H, W = map(int, input().split())
G = [sys.stdin.readline() for _ in range(H)]

counts = [[[-1] * 4 for _ in range(W + 1)] for _ in range(H + 1)]
for h in range(H):
    for w in range(W):
        if G[h][w] == ".":
            counts[h][w][0] = counts[h][w-1][0] + 1
            counts[h][w][1] = counts[h-1][w][1] + 1
        dih = H - h - 1
        diw = W - w - 1
        if G[dih][diw] == ".":
            counts[dih][diw][2] = counts[dih][diw+1][2] + 1
            counts[dih][diw][3] = counts[dih+1][diw][3] + 1
ans = 0
for h in range(H):
    for w in range(W):
        if G[h][w] == ".":
            ans = max(ans, sum(counts[h][w]) + 1)
print(ans)