H, W, *SS = open(0).read().split()
H, W = int(H), int(W)

R = [[0]*(W) for _ in [0]*(H)]
C = [[0]*(W) for _ in [0]*(H)]

for i, S in enumerate(SS):
    cnt = 0
    pre = S[0]
    for j, s in enumerate(S):
        if s == '.':
            cnt += 1
        else:
            if pre == '.':
                for k in range(1, cnt+1):
                    R[i][j-k] = cnt
                cnt = 0
        pre = s
    if pre == '.':
        for k in range(1, cnt+1):
            R[i][-k] = cnt

for j in range(W):
    cnt = 0
    pre = SS[0][j]
    for i in range(H):
        s = SS[i][j]
        if s == '.':
            cnt += 1
        else:
            if pre == '.':
                for k in range(1, cnt+1):
                    C[i-k][j] = cnt
                cnt = 0
        pre = s
    if pre == '.':
        for k in range(1, cnt+1):
            C[-k][j] = cnt

ans = 0
for i in range(H):
    for j in range(W):
        if R[i][j] and C[i][j]:
            area = R[i][j]+C[i][j]-1
            if ans < area:
                ans = area
print(ans) H, W, *SS = open(0).read().split() H open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split W *SS SS H, W = int(H), int(W) H int(H) int H W int(W) int W [0]*(W) for _ in [0]*(H) for _ in [0]*(H) _ [0]*(H) [0] 0 H for _ in [0]*(H) [0]*(W) [0] 0 W R = [[0]*(W) for _ in [0]*(H)] R [[0]*(W) for _ in [0]*(H)] [0]*(W) for _ in [0]*(H) for _ in [0]*(H) _ [0]*(H) [0] 0 H for _ in [0]*(H) [0]*(W) [0] 0 W C = [[0]*(W) for _ in [0]*(H)] C [[0]*(W) for _ in [0]*(H)] for i, S in enumerate(SS):
    cnt = 0
    pre = S[0]
    for j, s in enumerate(S):
        if s == '.':
            cnt += 1
        else:
            if pre == '.':
                for k in range(1, cnt+1):
                    R[i][j-k] = cnt
                cnt = 0
        pre = s
    if pre == '.':
        for k in range(1, cnt+1):
            R[i][-k] = cnt i S enumerate(SS) enumerate SS cnt = 0 cnt 0 pre = S[0] pre S[0] S 0 for j, s in enumerate(S):
        if s == '.':
            cnt += 1
        else:
            if pre == '.':
                for k in range(1, cnt+1):
                    R[i][j-k] = cnt
                cnt = 0
        pre = s
     j s enumerate(S) enumerate S if s == '.':
            cnt += 1
        else:
            if pre == '.':
                for k in range(1, cnt+1):
                    R[i][j-k] = cnt
                cnt = 0
         s == '.' s '.' cnt += 1 cnt 1 if pre == '.':
                for k in range(1, cnt+1):
                    R[i][j-k] = cnt
                cnt = 0
         pre == '.' pre '.' for k in range(1, cnt+1):
                    R[i][j-k] = cnt
                 k range(1, cnt+1) range 1 cnt+1 cnt 1 R[i][j-k] = cnt R[i][j-k] [i] R i j-k j k cnt cnt = 0 cnt 0 pre = s pre s if pre == '.':
        for k in range(1, cnt+1):
            R[i][-k] = cnt pre == '.' pre '.' for k in range(1, cnt+1):
            R[i][-k] = cnt k range(1, cnt+1) range 1 cnt+1 cnt 1 R[i][-k] = cnt R[i][-k] [i] R i -k k cnt for j in range(W):
    cnt = 0
    pre = SS[0][j]
    for i in range(H):
        s = SS[i][j]
        if s == '.':
            cnt += 1
        else:
            if pre == '.':
                for k in range(1, cnt+1):
                    C[i-k][j] = cnt
                cnt = 0
        pre = s
    if pre == '.':
        for k in range(1, cnt+1):
            C[-k][j] = cnt j range(W) range W cnt = 0 cnt 0 pre = SS[0][j] pre SS[0][j] [0] SS 0 j for i in range(H):
        s = SS[i][j]
        if s == '.':
            cnt += 1
        else:
            if pre == '.':
                for k in range(1, cnt+1):
                    C[i-k][j] = cnt
                cnt = 0
        pre = s
     i range(H) range H s = SS[i][j] s SS[i][j] [i] SS i j if s == '.':
            cnt += 1
        else:
            if pre == '.':
                for k in range(1, cnt+1):
                    C[i-k][j] = cnt
                cnt = 0
         s == '.' s '.' cnt += 1 cnt 1 if pre == '.':
                for k in range(1, cnt+1):
                    C[i-k][j] = cnt
                cnt = 0
         pre == '.' pre '.' for k in range(1, cnt+1):
                    C[i-k][j] = cnt
                 k range(1, cnt+1) range 1 cnt+1 cnt 1 C[i-k][j] = cnt C[i-k][j] [i-k] C i-k i k j cnt cnt = 0 cnt 0 pre = s pre s if pre == '.':
        for k in range(1, cnt+1):
            C[-k][j] = cnt pre == '.' pre '.' for k in range(1, cnt+1):
            C[-k][j] = cnt k range(1, cnt+1) range 1 cnt+1 cnt 1 C[-k][j] = cnt C[-k][j] [-k] C -k k j cnt ans = 0 ans 0 for i in range(H):
    for j in range(W):
        if R[i][j] and C[i][j]:
            area = R[i][j]+C[i][j]-1
            if ans < area:
                ans = area i range(H) range H for j in range(W):
        if R[i][j] and C[i][j]:
            area = R[i][j]+C[i][j]-1
            if ans < area:
                ans = area j range(W) range W if R[i][j] and C[i][j]:
            area = R[i][j]+C[i][j]-1
            if ans < area:
                ans = area R[i][j] and C[i][j] R[i][j] [i] R i j C[i][j] [i] C i j area = R[i][j]+C[i][j]-1 area R[i][j]+C[i][j]-1 R[i][j]+C[i][j] R[i][j] [i] R i j C[i][j] [i] C i j 1 if ans < area:
                ans = area ans < area ans area ans = area ans area print(ans) print ans cnt += 1 1 cnt H, W = int(H), int(W) int(H) H R = [[0]*(W) for _ in [0]*(H)] [[0]*(W) for _ in [0]*(H)] R cnt = 0 0 cnt W = int(H), int(W) int(W) W area = R[i][j]+C[i][j]-1 R[i][j]+C[i][j]-1 area W, *SS = open(0).read().split() open(0).read().split() W s = SS[i][j] SS[i][j] s cnt = 0 0 cnt pre = s s pre ans = 0 0 ans pre = S[0] S[0] pre ans = area area ans cnt = 0 0 cnt pre = SS[0][j] SS[0][j] pre cnt = 0 0 cnt pre = s s pre H, W, *SS = open(0).read().split() open(0).read().split() H C = [[0]*(W) for _ in [0]*(H)] [[0]*(W) for _ in [0]*(H)] C cnt += 1 1 cnt
H, W, *SS = open(0).read().split()
H, W = int(H), int(W)

R = [[0]*(W) for _ in [0]*(H)]
C = [[0]*(W) for _ in [0]*(H)]

for i, S in enumerate(SS):
    cnt = 0
    pre = S[0]
    for j, s in enumerate(S):
        if s == '.':
            cnt += 1
        else:
            if pre == '.':
                for k in range(1, cnt+1):
                    R[i][j-k] = cnt
                cnt = 0
        pre = s
    if pre == '.':
        for k in range(1, cnt+1):
            R[i][-k] = cnt

for j in range(W):
    cnt = 0
    pre = SS[0][j]
    for i in range(H):
        s = SS[i][j]
        if s == '.':
            cnt += 1
        else:
            if pre == '.':
                for k in range(1, cnt+1):
                    C[i-k][j] = cnt
                cnt = 0
        pre = s
    if pre == '.':
        for k in range(1, cnt+1):
            C[-k][j] = cnt

ans = 0
for i in range(H):
    for j in range(W):
        if R[i][j] and C[i][j]:
            area = R[i][j]+C[i][j]-1
            if ans < area:
                ans = area
print(ans)