n,m = map(int, input().split())

S = [[] for _ in range(n)]

for i in range(n):
    S[i] = list(input())

rows = [[] for _ in range(n)]
cols = [[] for _ in range(m)]

start = [[] for _ in range(n)]
end = [[] for _ in range(n)]

for i in range(n):
    rows[i].append(-1)
    for j in range(m):
        if(S[i][j] == '#'):
            rows[i].append(j)
    rows[i].append(m)

    l = 0
    r = 1
    cnt = 0

    for j in range(m):
        if(S[i][j] != '#'):
            start[i].append(rows[i][r] - rows[i][l])
        else:
            start[i].append(0)
        if(j == rows[i][r]):
            l = r
            r = r + 1
ans = 0
for i in range(m):
    cols[i].append(-1)

    for j in range(n):
        if(S[j][i] == '#'):
            cols[i].append(j)
    cols[i].append(n)

    l = 0
    r = 1
    cnt = 0

    for j in range(n):
        if(S[j][i] != '#'):
            end[j].append(cols[i][r] - cols[i][l])
            # ans = max(ans, start[j][i], end[j][i])
        else:
            end[j].append(0)
        if(j == cols[i][r]):
            l = r
            r = r + 1
        



for i in range(n):
    for j in range(m):
        # if(S[i][j] != '#'):
            ans = max(ans, start[i][j] + end[i][j])

print(ans - 3)

 n,m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m [] for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) [] S = [[] for _ in range(n)] S [[] for _ in range(n)] for i in range(n):
    S[i] = list(input()) i range(n) range n S[i] = list(input()) S[i] S i list(input()) list input() input [] for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) [] rows = [[] for _ in range(n)] rows [[] for _ in range(n)] [] for _ in range(m) for _ in range(m) _ range(m) range m for _ in range(m) [] cols = [[] for _ in range(m)] cols [[] for _ in range(m)] [] for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) [] start = [[] for _ in range(n)] start [[] for _ in range(n)] [] for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) [] end = [[] for _ in range(n)] end [[] for _ in range(n)] for i in range(n):
    rows[i].append(-1)
    for j in range(m):
        if(S[i][j] == '#'):
            rows[i].append(j)
    rows[i].append(m)

    l = 0
    r = 1
    cnt = 0

    for j in range(m):
        if(S[i][j] != '#'):
            start[i].append(rows[i][r] - rows[i][l])
        else:
            start[i].append(0)
        if(j == rows[i][r]):
            l = r
            r = r + 1 i range(n) range n rows[i].append(-1) [i].append [i] rows i append -1 for j in range(m):
        if(S[i][j] == '#'):
            rows[i].append(j)
     j range(m) range m if(S[i][j] == '#'):
            rows[i].append(j)
     S[i][j] == '#' S[i][j] [i] S i j '#' rows[i].append(j) [i].append [i] rows i append j rows[i].append(m) [i].append [i] rows i append m l = 0 l 0 r = 1 r 1 cnt = 0 cnt 0 for j in range(m):
        if(S[i][j] != '#'):
            start[i].append(rows[i][r] - rows[i][l])
        else:
            start[i].append(0)
        if(j == rows[i][r]):
            l = r
            r = r + 1 j range(m) range m if(S[i][j] != '#'):
            start[i].append(rows[i][r] - rows[i][l])
        else:
            start[i].append(0)
         S[i][j] != '#' S[i][j] [i] S i j '#' start[i].append(rows[i][r] - rows[i][l]) [i].append [i] start i append rows[i][r] - rows[i][l] rows[i][r] [i] rows i r rows[i][l] [i] rows i l start[i].append(0) [i].append [i] start i append 0 if(j == rows[i][r]):
            l = r
            r = r + 1 j == rows[i][r] j rows[i][r] [i] rows i r l = r l r r = r + 1 r r + 1 r 1 ans = 0 ans 0 for i in range(m):
    cols[i].append(-1)

    for j in range(n):
        if(S[j][i] == '#'):
            cols[i].append(j)
    cols[i].append(n)

    l = 0
    r = 1
    cnt = 0

    for j in range(n):
        if(S[j][i] != '#'):
            end[j].append(cols[i][r] - cols[i][l])
            # ans = max(ans, start[j][i], end[j][i])
        else:
            end[j].append(0)
        if(j == cols[i][r]):
            l = r
            r = r + 1
         i range(m) range m cols[i].append(-1) [i].append [i] cols i append -1 for j in range(n):
        if(S[j][i] == '#'):
            cols[i].append(j)
     j range(n) range n if(S[j][i] == '#'):
            cols[i].append(j)
     S[j][i] == '#' S[j][i] [j] S j i '#' cols[i].append(j) [i].append [i] cols i append j cols[i].append(n) [i].append [i] cols i append n l = 0 l 0 r = 1 r 1 cnt = 0 cnt 0 for j in range(n):
        if(S[j][i] != '#'):
            end[j].append(cols[i][r] - cols[i][l])
            # ans = max(ans, start[j][i], end[j][i])
        else:
            end[j].append(0)
        if(j == cols[i][r]):
            l = r
            r = r + 1
         j range(n) range n if(S[j][i] != '#'):
            end[j].append(cols[i][r] - cols[i][l])
            # ans = max(ans, start[j][i], end[j][i])
        else:
            end[j].append(0)
         S[j][i] != '#' S[j][i] [j] S j i '#' end[j].append(cols[i][r] - cols[i][l]) [j].append [j] end j append cols[i][r] - cols[i][l] cols[i][r] [i] cols i r cols[i][l] [i] cols i l end[j].append(0) [j].append [j] end j append 0 if(j == cols[i][r]):
            l = r
            r = r + 1
         j == cols[i][r] j cols[i][r] [i] cols i r l = r l r r = r + 1 r r + 1 r 1 for i in range(n):
    for j in range(m):
        # if(S[i][j] != '#'):
            ans = max(ans, start[i][j] + end[i][j]) i range(n) range n for j in range(m):
        # if(S[i][j] != '#'):
            ans = max(ans, start[i][j] + end[i][j]) j range(m) range m ans = max(ans, start[i][j] + end[i][j]) ans max(ans, start[i][j] + end[i][j]) max ans start[i][j] + end[i][j] start[i][j] [i] start i j end[i][j] [i] end i j print(ans - 3) print ans - 3 ans 3 n,m = map(int, input().split()) map(int, input().split()) n r = 1 1 r start = [[] for _ in range(n)] [[] for _ in range(n)] start r = r + 1 r + 1 r S = [[] for _ in range(n)] [[] for _ in range(n)] S rows = [[] for _ in range(n)] [[] for _ in range(n)] rows l = r r l r = r + 1 r + 1 r cnt = 0 0 cnt r = 1 1 r cols = [[] for _ in range(m)] [[] for _ in range(m)] cols ans = 0 0 ans l = 0 0 l cnt = 0 0 cnt l = r r l ans = max(ans, start[i][j] + end[i][j]) max(ans, start[i][j] + end[i][j]) ans l = 0 0 l m = map(int, input().split()) map(int, input().split()) m end = [[] for _ in range(n)] [[] for _ in range(n)] end
n,m = map(int, input().split())

S = [[] for _ in range(n)]

for i in range(n):
    S[i] = list(input())

rows = [[] for _ in range(n)]
cols = [[] for _ in range(m)]

start = [[] for _ in range(n)]
end = [[] for _ in range(n)]

for i in range(n):
    rows[i].append(-1)
    for j in range(m):
        if(S[i][j] == '#'):
            rows[i].append(j)
    rows[i].append(m)

    l = 0
    r = 1
    cnt = 0

    for j in range(m):
        if(S[i][j] != '#'):
            start[i].append(rows[i][r] - rows[i][l])
        else:
            start[i].append(0)
        if(j == rows[i][r]):
            l = r
            r = r + 1
ans = 0
for i in range(m):
    cols[i].append(-1)

    for j in range(n):
        if(S[j][i] == '#'):
            cols[i].append(j)
    cols[i].append(n)

    l = 0
    r = 1
    cnt = 0

    for j in range(n):
        if(S[j][i] != '#'):
            end[j].append(cols[i][r] - cols[i][l])
            # ans = max(ans, start[j][i], end[j][i])
        else:
            end[j].append(0)
        if(j == cols[i][r]):
            l = r
            r = r + 1
        



for i in range(n):
    for j in range(m):
        # if(S[i][j] != '#'):
            ans = max(ans, start[i][j] + end[i][j])

print(ans - 3)


