import sys
def input(): return sys.stdin.readline().strip()


def main():
    H, W = map(int, input().split())
    S = [input() for _ in range(H)]

    """まずは縦に何連続かだけ計測"""
    dp = [[0] * W for _ in range(H)]
    # 0列目
    for j in range(W):
        if S[0][j] != '#':
            dp[0][j] = 1
    # dp-part
    for i in range(1, H):
        for j in range(W):
            if S[i][j] != '#':
                dp[i][j] = dp[i - 1][j] + 1
            else:
                num = dp[i - 1][j]
                for k in range(num):
                    dp[i - 1 - k][j] = num
    # last-line
    for j in range(W):
        num = dp[H - 1][j]
        for k in range(num):
            dp[H - 1 - k][j] = num
    
    """次に横に何連続かを計測"""

    dp2 = [[0] * W for _ in range(H)]
    # 0列目
    for i in range(H):
        if S[i][0] != '#':
            dp2[i][0] = 1
    # dp-part
    for j in range(1, W):
        for i in range(H):
            if S[i][j] != '#':
                dp2[i][j] = dp2[i][j - 1] + 1
            else:
                num = dp2[i][j - 1]
                for k in range(num):
                    dp2[i][j - 1 - k] = num
    # last-line
    for i in range(H):
        num = dp2[i][W - 1]
        for k in range(num):
            dp2[i][W - 1 - k] = num
    
    ans = 0
    for i in range(H):
        for j in range(W):
            ans = max(ans, dp[i][j] + dp2[i][j] - 1)
    print(ans)



if __name__ == "__main__":
    main() import sys sys def input(): return sys.stdin.readline().strip() input def main():
    H, W = map(int, input().split())
    S = [input() for _ in range(H)]

    """まずは縦に何連続かだけ計測"""
    dp = [[0] * W for _ in range(H)]
    # 0列目
    for j in range(W):
        if S[0][j] != '#':
            dp[0][j] = 1
    # dp-part
    for i in range(1, H):
        for j in range(W):
            if S[i][j] != '#':
                dp[i][j] = dp[i - 1][j] + 1
            else:
                num = dp[i - 1][j]
                for k in range(num):
                    dp[i - 1 - k][j] = num
    # last-line
    for j in range(W):
        num = dp[H - 1][j]
        for k in range(num):
            dp[H - 1 - k][j] = num
    
    """次に横に何連続かを計測"""

    dp2 = [[0] * W for _ in range(H)]
    # 0列目
    for i in range(H):
        if S[i][0] != '#':
            dp2[i][0] = 1
    # dp-part
    for j in range(1, W):
        for i in range(H):
            if S[i][j] != '#':
                dp2[i][j] = dp2[i][j - 1] + 1
            else:
                num = dp2[i][j - 1]
                for k in range(num):
                    dp2[i][j - 1 - k] = num
    # last-line
    for i in range(H):
        num = dp2[i][W - 1]
        for k in range(num):
            dp2[i][W - 1 - k] = num
    
    ans = 0
    for i in range(H):
        for j in range(W):
            ans = max(ans, dp[i][j] + dp2[i][j] - 1)
    print(ans) main H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W input() for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) input() input S = [input() for _ in range(H)] S [input() for _ in range(H)] """まずは縦に何連続かだけ計測""" [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W dp = [[0] * W for _ in range(H)] dp [[0] * W for _ in range(H)] for j in range(W):
        if S[0][j] != '#':
            dp[0][j] = 1
    # dp-part
     j range(W) range W if S[0][j] != '#':
            dp[0][j] = 1
    # dp-part
     S[0][j] != '#' S[0][j] [0] S 0 j '#' dp[0][j] = 1 dp[0][j] [0] dp 0 j 1 for i in range(1, H):
        for j in range(W):
            if S[i][j] != '#':
                dp[i][j] = dp[i - 1][j] + 1
            else:
                num = dp[i - 1][j]
                for k in range(num):
                    dp[i - 1 - k][j] = num
    # last-line
     i range(1, H) range 1 H for j in range(W):
            if S[i][j] != '#':
                dp[i][j] = dp[i - 1][j] + 1
            else:
                num = dp[i - 1][j]
                for k in range(num):
                    dp[i - 1 - k][j] = num
    # last-line
     j range(W) range W if S[i][j] != '#':
                dp[i][j] = dp[i - 1][j] + 1
            else:
                num = dp[i - 1][j]
                for k in range(num):
                    dp[i - 1 - k][j] = num
    # last-line
     S[i][j] != '#' S[i][j] [i] S i j '#' dp[i][j] = dp[i - 1][j] + 1 dp[i][j] [i] dp i j dp[i - 1][j] + 1 dp[i - 1][j] [i - 1] dp i - 1 i 1 j 1 num = dp[i - 1][j] num dp[i - 1][j] [i - 1] dp i - 1 i 1 j for k in range(num):
                    dp[i - 1 - k][j] = num
    # last-line
     k range(num) range num dp[i - 1 - k][j] = num dp[i - 1 - k][j] [i - 1 - k] dp i - 1 - k i - 1 i 1 k j num for j in range(W):
        num = dp[H - 1][j]
        for k in range(num):
            dp[H - 1 - k][j] = num
    
     j range(W) range W num = dp[H - 1][j] num dp[H - 1][j] [H - 1] dp H - 1 H 1 j for k in range(num):
            dp[H - 1 - k][j] = num
    
     k range(num) range num dp[H - 1 - k][j] = num dp[H - 1 - k][j] [H - 1 - k] dp H - 1 - k H - 1 H 1 k j num """次に横に何連続かを計測""" [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W dp2 = [[0] * W for _ in range(H)] dp2 [[0] * W for _ in range(H)] for i in range(H):
        if S[i][0] != '#':
            dp2[i][0] = 1
    # dp-part
     i range(H) range H if S[i][0] != '#':
            dp2[i][0] = 1
    # dp-part
     S[i][0] != '#' S[i][0] [i] S i 0 '#' dp2[i][0] = 1 dp2[i][0] [i] dp2 i 0 1 for j in range(1, W):
        for i in range(H):
            if S[i][j] != '#':
                dp2[i][j] = dp2[i][j - 1] + 1
            else:
                num = dp2[i][j - 1]
                for k in range(num):
                    dp2[i][j - 1 - k] = num
    # last-line
     j range(1, W) range 1 W for i in range(H):
            if S[i][j] != '#':
                dp2[i][j] = dp2[i][j - 1] + 1
            else:
                num = dp2[i][j - 1]
                for k in range(num):
                    dp2[i][j - 1 - k] = num
    # last-line
     i range(H) range H if S[i][j] != '#':
                dp2[i][j] = dp2[i][j - 1] + 1
            else:
                num = dp2[i][j - 1]
                for k in range(num):
                    dp2[i][j - 1 - k] = num
    # last-line
     S[i][j] != '#' S[i][j] [i] S i j '#' dp2[i][j] = dp2[i][j - 1] + 1 dp2[i][j] [i] dp2 i j dp2[i][j - 1] + 1 dp2[i][j - 1] [i] dp2 i j - 1 j 1 1 num = dp2[i][j - 1] num dp2[i][j - 1] [i] dp2 i j - 1 j 1 for k in range(num):
                    dp2[i][j - 1 - k] = num
    # last-line
     k range(num) range num dp2[i][j - 1 - k] = num dp2[i][j - 1 - k] [i] dp2 i j - 1 - k j - 1 j 1 k num for i in range(H):
        num = dp2[i][W - 1]
        for k in range(num):
            dp2[i][W - 1 - k] = num
    
     i range(H) range H num = dp2[i][W - 1] num dp2[i][W - 1] [i] dp2 i W - 1 W 1 for k in range(num):
            dp2[i][W - 1 - k] = num
    
     k range(num) range num dp2[i][W - 1 - k] = num dp2[i][W - 1 - k] [i] dp2 i W - 1 - k W - 1 W 1 k num ans = 0 ans 0 for i in range(H):
        for j in range(W):
            ans = max(ans, dp[i][j] + dp2[i][j] - 1)
     i range(H) range H for j in range(W):
            ans = max(ans, dp[i][j] + dp2[i][j] - 1)
     j range(W) range W ans = max(ans, dp[i][j] + dp2[i][j] - 1) ans max(ans, dp[i][j] + dp2[i][j] - 1) max ans dp[i][j] + dp2[i][j] - 1 dp[i][j] + dp2[i][j] dp[i][j] [i] dp i j dp2[i][j] [i] dp2 i j 1 print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    H, W = map(int, input().split())
    S = [input() for _ in range(H)]

    """まずは縦に何連続かだけ計測"""
    dp = [[0] * W for _ in range(H)]
    # 0列目
    for j in range(W):
        if S[0][j] != '#':
            dp[0][j] = 1
    # dp-part
    for i in range(1, H):
        for j in range(W):
            if S[i][j] != '#':
                dp[i][j] = dp[i - 1][j] + 1
            else:
                num = dp[i - 1][j]
                for k in range(num):
                    dp[i - 1 - k][j] = num
    # last-line
    for j in range(W):
        num = dp[H - 1][j]
        for k in range(num):
            dp[H - 1 - k][j] = num
    
    """次に横に何連続かを計測"""

    dp2 = [[0] * W for _ in range(H)]
    # 0列目
    for i in range(H):
        if S[i][0] != '#':
            dp2[i][0] = 1
    # dp-part
    for j in range(1, W):
        for i in range(H):
            if S[i][j] != '#':
                dp2[i][j] = dp2[i][j - 1] + 1
            else:
                num = dp2[i][j - 1]
                for k in range(num):
                    dp2[i][j - 1 - k] = num
    # last-line
    for i in range(H):
        num = dp2[i][W - 1]
        for k in range(num):
            dp2[i][W - 1 - k] = num
    
    ans = 0
    for i in range(H):
        for j in range(W):
            ans = max(ans, dp[i][j] + dp2[i][j] - 1)
    print(ans) def main():
    H, W = map(int, input().split())
    S = [input() for _ in range(H)]

    """まずは縦に何連続かだけ計測"""
    dp = [[0] * W for _ in range(H)]
    # 0列目
    for j in range(W):
        if S[0][j] != '#':
            dp[0][j] = 1
    # dp-part
    for i in range(1, H):
        for j in range(W):
            if S[i][j] != '#':
                dp[i][j] = dp[i - 1][j] + 1
            else:
                num = dp[i - 1][j]
                for k in range(num):
                    dp[i - 1 - k][j] = num
    # last-line
    for j in range(W):
        num = dp[H - 1][j]
        for k in range(num):
            dp[H - 1 - k][j] = num
    
    """次に横に何連続かを計測"""

    dp2 = [[0] * W for _ in range(H)]
    # 0列目
    for i in range(H):
        if S[i][0] != '#':
            dp2[i][0] = 1
    # dp-part
    for j in range(1, W):
        for i in range(H):
            if S[i][j] != '#':
                dp2[i][j] = dp2[i][j - 1] + 1
            else:
                num = dp2[i][j - 1]
                for k in range(num):
                    dp2[i][j - 1 - k] = num
    # last-line
    for i in range(H):
        num = dp2[i][W - 1]
        for k in range(num):
            dp2[i][W - 1 - k] = num
    
    ans = 0
    for i in range(H):
        for j in range(W):
            ans = max(ans, dp[i][j] + dp2[i][j] - 1)
    print(ans) main def input(): return sys.stdin.readline().strip() def input(): return sys.stdin.readline().strip() input
import sys
def input(): return sys.stdin.readline().strip()


def main():
    H, W = map(int, input().split())
    S = [input() for _ in range(H)]

    """まずは縦に何連続かだけ計測"""
    dp = [[0] * W for _ in range(H)]
    # 0列目
    for j in range(W):
        if S[0][j] != '#':
            dp[0][j] = 1
    # dp-part
    for i in range(1, H):
        for j in range(W):
            if S[i][j] != '#':
                dp[i][j] = dp[i - 1][j] + 1
            else:
                num = dp[i - 1][j]
                for k in range(num):
                    dp[i - 1 - k][j] = num
    # last-line
    for j in range(W):
        num = dp[H - 1][j]
        for k in range(num):
            dp[H - 1 - k][j] = num
    
    """次に横に何連続かを計測"""

    dp2 = [[0] * W for _ in range(H)]
    # 0列目
    for i in range(H):
        if S[i][0] != '#':
            dp2[i][0] = 1
    # dp-part
    for j in range(1, W):
        for i in range(H):
            if S[i][j] != '#':
                dp2[i][j] = dp2[i][j - 1] + 1
            else:
                num = dp2[i][j - 1]
                for k in range(num):
                    dp2[i][j - 1 - k] = num
    # last-line
    for i in range(H):
        num = dp2[i][W - 1]
        for k in range(num):
            dp2[i][W - 1 - k] = num
    
    ans = 0
    for i in range(H):
        for j in range(W):
            ans = max(ans, dp[i][j] + dp2[i][j] - 1)
    print(ans)



if __name__ == "__main__":
    main()
