import sys
import copy

input = sys.stdin.readline

def mymax(a, b, c=None):
    """
        最大値を返すメソッド.
        値が2, 3つの場合のみ対応している.
    """
    if c == None:
        if a > b:
            return a
        else:
            return b

    if a > b:
        if c > a:
            return c
        else:
            return a
    else:
        if c > b:
            return c
        else:
            return b

def main():
    H, W = map(int, input().split())
    grid = []
    for _ in range(H):
        grid.append(list(input()[:-1]))
    
    L = [[0] * W for _ in range(H)]
    R = copy.deepcopy(L)
    U = copy.deepcopy(L)
    D = copy.deepcopy(L)
    
    for h in range(H):
        cntL, cntR = 0, 0
        for w in range(W):
            wreverse = W - w - 1
            if grid[h][w] == '.':
                cntL += 1
            else:
                cntL = 0
            if grid[h][wreverse] == '.':
                cntR += 1
            else:
                cntR = 0
            L[h][w] = cntL
            R[h][wreverse] = cntR

    for w in range(W):
        cntU, cntD = 0, 0
        for h in range(H):
            hreverse = H - h - 1
            if grid[h][w] == '.':
                cntU += 1
            else:
                cntU = 0
            if grid[hreverse][w] == '.':
                cntD += 1
            else:
                cntD = 0
            U[h][w] = cntU
            D[hreverse][w] = cntD
    
    ans = 0
    for h in range(H):
        for w in range(W):
            ans = mymax(ans, L[h][w] + R[h][w] + U[h][w] + D[h][w] - 3)

    print(ans)
        
if __name__ == "__main__":
    main() import sys sys import copy copy input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def mymax(a, b, c=None):
    """
        最大値を返すメソッド.
        値が2, 3つの場合のみ対応している.
    """
    if c == None:
        if a > b:
            return a
        else:
            return b

    if a > b:
        if c > a:
            return c
        else:
            return a
    else:
        if c > b:
            return c
        else:
            return b mymax """
        最大値を返すメソッド.
        値が2, 3つの場合のみ対応している.
    """ if c == None:
        if a > b:
            return a
        else:
            return b

     c == None c None if a > b:
            return a
        else:
            return b

     a > b a b return a a return b b if a > b:
        if c > a:
            return c
        else:
            return a
    else:
        if c > b:
            return c
        else:
            return b a > b a b if c > a:
            return c
        else:
            return a
     c > a c a return c c return a a if c > b:
            return c
        else:
            return b c > b c b return c c return b b a a b b c=None c None def main():
    H, W = map(int, input().split())
    grid = []
    for _ in range(H):
        grid.append(list(input()[:-1]))
    
    L = [[0] * W for _ in range(H)]
    R = copy.deepcopy(L)
    U = copy.deepcopy(L)
    D = copy.deepcopy(L)
    
    for h in range(H):
        cntL, cntR = 0, 0
        for w in range(W):
            wreverse = W - w - 1
            if grid[h][w] == '.':
                cntL += 1
            else:
                cntL = 0
            if grid[h][wreverse] == '.':
                cntR += 1
            else:
                cntR = 0
            L[h][w] = cntL
            R[h][wreverse] = cntR

    for w in range(W):
        cntU, cntD = 0, 0
        for h in range(H):
            hreverse = H - h - 1
            if grid[h][w] == '.':
                cntU += 1
            else:
                cntU = 0
            if grid[hreverse][w] == '.':
                cntD += 1
            else:
                cntD = 0
            U[h][w] = cntU
            D[hreverse][w] = cntD
    
    ans = 0
    for h in range(H):
        for w in range(W):
            ans = mymax(ans, L[h][w] + R[h][w] + U[h][w] + D[h][w] - 3)

    print(ans)
         main H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W grid = [] grid [] for _ in range(H):
        grid.append(list(input()[:-1]))
    
     _ range(H) range H grid.append(list(input()[:-1])) grid.append grid append list(input()[:-1]) list input()[:-1] () input :-1 -1 [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W L = [[0] * W for _ in range(H)] L [[0] * W for _ in range(H)] R = copy.deepcopy(L) R copy.deepcopy(L) copy.deepcopy copy deepcopy L U = copy.deepcopy(L) U copy.deepcopy(L) copy.deepcopy copy deepcopy L D = copy.deepcopy(L) D copy.deepcopy(L) copy.deepcopy copy deepcopy L for h in range(H):
        cntL, cntR = 0, 0
        for w in range(W):
            wreverse = W - w - 1
            if grid[h][w] == '.':
                cntL += 1
            else:
                cntL = 0
            if grid[h][wreverse] == '.':
                cntR += 1
            else:
                cntR = 0
            L[h][w] = cntL
            R[h][wreverse] = cntR

     h range(H) range H cntL, cntR = 0, 0 cntL 0 cntR 0 for w in range(W):
            wreverse = W - w - 1
            if grid[h][w] == '.':
                cntL += 1
            else:
                cntL = 0
            if grid[h][wreverse] == '.':
                cntR += 1
            else:
                cntR = 0
            L[h][w] = cntL
            R[h][wreverse] = cntR

     w range(W) range W wreverse = W - w - 1 wreverse W - w - 1 W - w W w 1 if grid[h][w] == '.':
                cntL += 1
            else:
                cntL = 0
             grid[h][w] == '.' grid[h][w] [h] grid h w '.' cntL += 1 cntL 1 cntL = 0 cntL 0 if grid[h][wreverse] == '.':
                cntR += 1
            else:
                cntR = 0
             grid[h][wreverse] == '.' grid[h][wreverse] [h] grid h wreverse '.' cntR += 1 cntR 1 cntR = 0 cntR 0 L[h][w] = cntL L[h][w] [h] L h w cntL R[h][wreverse] = cntR R[h][wreverse] [h] R h wreverse cntR for w in range(W):
        cntU, cntD = 0, 0
        for h in range(H):
            hreverse = H - h - 1
            if grid[h][w] == '.':
                cntU += 1
            else:
                cntU = 0
            if grid[hreverse][w] == '.':
                cntD += 1
            else:
                cntD = 0
            U[h][w] = cntU
            D[hreverse][w] = cntD
    
     w range(W) range W cntU, cntD = 0, 0 cntU 0 cntD 0 for h in range(H):
            hreverse = H - h - 1
            if grid[h][w] == '.':
                cntU += 1
            else:
                cntU = 0
            if grid[hreverse][w] == '.':
                cntD += 1
            else:
                cntD = 0
            U[h][w] = cntU
            D[hreverse][w] = cntD
    
     h range(H) range H hreverse = H - h - 1 hreverse H - h - 1 H - h H h 1 if grid[h][w] == '.':
                cntU += 1
            else:
                cntU = 0
             grid[h][w] == '.' grid[h][w] [h] grid h w '.' cntU += 1 cntU 1 cntU = 0 cntU 0 if grid[hreverse][w] == '.':
                cntD += 1
            else:
                cntD = 0
             grid[hreverse][w] == '.' grid[hreverse][w] [hreverse] grid hreverse w '.' cntD += 1 cntD 1 cntD = 0 cntD 0 U[h][w] = cntU U[h][w] [h] U h w cntU D[hreverse][w] = cntD D[hreverse][w] [hreverse] D hreverse w cntD ans = 0 ans 0 for h in range(H):
        for w in range(W):
            ans = mymax(ans, L[h][w] + R[h][w] + U[h][w] + D[h][w] - 3)

     h range(H) range H for w in range(W):
            ans = mymax(ans, L[h][w] + R[h][w] + U[h][w] + D[h][w] - 3)

     w range(W) range W ans = mymax(ans, L[h][w] + R[h][w] + U[h][w] + D[h][w] - 3) ans mymax(ans, L[h][w] + R[h][w] + U[h][w] + D[h][w] - 3) mymax ans L[h][w] + R[h][w] + U[h][w] + D[h][w] - 3 L[h][w] + R[h][w] + U[h][w] + D[h][w] L[h][w] + R[h][w] + U[h][w] L[h][w] + R[h][w] L[h][w] [h] L h w R[h][w] [h] R h w U[h][w] [h] U h w D[h][w] [h] D h w 3 print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    H, W = map(int, input().split())
    grid = []
    for _ in range(H):
        grid.append(list(input()[:-1]))
    
    L = [[0] * W for _ in range(H)]
    R = copy.deepcopy(L)
    U = copy.deepcopy(L)
    D = copy.deepcopy(L)
    
    for h in range(H):
        cntL, cntR = 0, 0
        for w in range(W):
            wreverse = W - w - 1
            if grid[h][w] == '.':
                cntL += 1
            else:
                cntL = 0
            if grid[h][wreverse] == '.':
                cntR += 1
            else:
                cntR = 0
            L[h][w] = cntL
            R[h][wreverse] = cntR

    for w in range(W):
        cntU, cntD = 0, 0
        for h in range(H):
            hreverse = H - h - 1
            if grid[h][w] == '.':
                cntU += 1
            else:
                cntU = 0
            if grid[hreverse][w] == '.':
                cntD += 1
            else:
                cntD = 0
            U[h][w] = cntU
            D[hreverse][w] = cntD
    
    ans = 0
    for h in range(H):
        for w in range(W):
            ans = mymax(ans, L[h][w] + R[h][w] + U[h][w] + D[h][w] - 3)

    print(ans)
         def main():
    H, W = map(int, input().split())
    grid = []
    for _ in range(H):
        grid.append(list(input()[:-1]))
    
    L = [[0] * W for _ in range(H)]
    R = copy.deepcopy(L)
    U = copy.deepcopy(L)
    D = copy.deepcopy(L)
    
    for h in range(H):
        cntL, cntR = 0, 0
        for w in range(W):
            wreverse = W - w - 1
            if grid[h][w] == '.':
                cntL += 1
            else:
                cntL = 0
            if grid[h][wreverse] == '.':
                cntR += 1
            else:
                cntR = 0
            L[h][w] = cntL
            R[h][wreverse] = cntR

    for w in range(W):
        cntU, cntD = 0, 0
        for h in range(H):
            hreverse = H - h - 1
            if grid[h][w] == '.':
                cntU += 1
            else:
                cntU = 0
            if grid[hreverse][w] == '.':
                cntD += 1
            else:
                cntD = 0
            U[h][w] = cntU
            D[hreverse][w] = cntD
    
    ans = 0
    for h in range(H):
        for w in range(W):
            ans = mymax(ans, L[h][w] + R[h][w] + U[h][w] + D[h][w] - 3)

    print(ans)
         main input = sys.stdin.readline sys.stdin.readline input def mymax(a, b, c=None):
    """
        最大値を返すメソッド.
        値が2, 3つの場合のみ対応している.
    """
    if c == None:
        if a > b:
            return a
        else:
            return b

    if a > b:
        if c > a:
            return c
        else:
            return a
    else:
        if c > b:
            return c
        else:
            return b def mymax(a, b, c=None):
    """
        最大値を返すメソッド.
        値が2, 3つの場合のみ対応している.
    """
    if c == None:
        if a > b:
            return a
        else:
            return b

    if a > b:
        if c > a:
            return c
        else:
            return a
    else:
        if c > b:
            return c
        else:
            return b mymax
import sys
import copy

input = sys.stdin.readline

def mymax(a, b, c=None):
    """
        最大値を返すメソッド.
        値が2, 3つの場合のみ対応している.
    """
    if c == None:
        if a > b:
            return a
        else:
            return b

    if a > b:
        if c > a:
            return c
        else:
            return a
    else:
        if c > b:
            return c
        else:
            return b

def main():
    H, W = map(int, input().split())
    grid = []
    for _ in range(H):
        grid.append(list(input()[:-1]))
    
    L = [[0] * W for _ in range(H)]
    R = copy.deepcopy(L)
    U = copy.deepcopy(L)
    D = copy.deepcopy(L)
    
    for h in range(H):
        cntL, cntR = 0, 0
        for w in range(W):
            wreverse = W - w - 1
            if grid[h][w] == '.':
                cntL += 1
            else:
                cntL = 0
            if grid[h][wreverse] == '.':
                cntR += 1
            else:
                cntR = 0
            L[h][w] = cntL
            R[h][wreverse] = cntR

    for w in range(W):
        cntU, cntD = 0, 0
        for h in range(H):
            hreverse = H - h - 1
            if grid[h][w] == '.':
                cntU += 1
            else:
                cntU = 0
            if grid[hreverse][w] == '.':
                cntD += 1
            else:
                cntD = 0
            U[h][w] = cntU
            D[hreverse][w] = cntD
    
    ans = 0
    for h in range(H):
        for w in range(W):
            ans = mymax(ans, L[h][w] + R[h][w] + U[h][w] + D[h][w] - 3)

    print(ans)
        
if __name__ == "__main__":
    main()
