import sys
from itertools import groupby, chain
def input(): return sys.stdin.readline().rstrip()


def trans(l_2d):
    return [list(x) for x in zip(*l_2d)]


def lamp(arr):
    count = [[] for i in range(len(arr))]
    for i in range(len(arr)):
        lamps = []
        for key, value in groupby(arr[i]):
            n = int(len(list(value)))
            if key == '.':
                lamps += [n]*n
            else:
                lamps += [0]*n
        count[i] = lamps
    return count


def main():
    h, w = map(int, input().split())
    s = [list(input()) for i in range(h)]
    tate = lamp(s)
    yoko = lamp(trans(s))
    ans=0
    for hh in range(h):
        for ww in range(w):
            ans=max(ans,tate[hh][ww]+yoko[ww][hh]-1)
    print(ans)
        


if __name__ == '__main__':
    main() import sys sys from itertools import groupby, chain def input(): return sys.stdin.readline().rstrip() input def trans(l_2d):
    return [list(x) for x in zip(*l_2d)] trans list(x) for x in zip(*l_2d) for x in zip(*l_2d) x zip(*l_2d) zip *l_2d l_2d for x in zip(*l_2d) list(x) list x return [list(x) for x in zip(*l_2d)] [list(x) for x in zip(*l_2d)] l_2d l_2d def lamp(arr):
    count = [[] for i in range(len(arr))]
    for i in range(len(arr)):
        lamps = []
        for key, value in groupby(arr[i]):
            n = int(len(list(value)))
            if key == '.':
                lamps += [n]*n
            else:
                lamps += [0]*n
        count[i] = lamps
    return count lamp [] for i in range(len(arr)) for i in range(len(arr)) i range(len(arr)) range len(arr) len arr for i in range(len(arr)) [] count = [[] for i in range(len(arr))] count [[] for i in range(len(arr))] for i in range(len(arr)):
        lamps = []
        for key, value in groupby(arr[i]):
            n = int(len(list(value)))
            if key == '.':
                lamps += [n]*n
            else:
                lamps += [0]*n
        count[i] = lamps
     i range(len(arr)) range len(arr) len arr lamps = [] lamps [] for key, value in groupby(arr[i]):
            n = int(len(list(value)))
            if key == '.':
                lamps += [n]*n
            else:
                lamps += [0]*n
         key value groupby(arr[i]) groupby arr[i] arr i n = int(len(list(value))) n int(len(list(value))) int len(list(value)) len list(value) list value if key == '.':
                lamps += [n]*n
            else:
                lamps += [0]*n
         key == '.' key '.' lamps += [n]*n lamps [n]*n [n] n n lamps += [0]*n lamps [0]*n [0] 0 n count[i] = lamps count[i] count i lamps return count count arr arr def main():
    h, w = map(int, input().split())
    s = [list(input()) for i in range(h)]
    tate = lamp(s)
    yoko = lamp(trans(s))
    ans=0
    for hh in range(h):
        for ww in range(w):
            ans=max(ans,tate[hh][ww]+yoko[ww][hh]-1)
    print(ans)
         main h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w list(input()) for i in range(h) for i in range(h) i range(h) range h for i in range(h) list(input()) list input() input s = [list(input()) for i in range(h)] s [list(input()) for i in range(h)] tate = lamp(s) tate lamp(s) lamp s yoko = lamp(trans(s)) yoko lamp(trans(s)) lamp trans(s) trans s ans=0 ans 0 for hh in range(h):
        for ww in range(w):
            ans=max(ans,tate[hh][ww]+yoko[ww][hh]-1)
     hh range(h) range h for ww in range(w):
            ans=max(ans,tate[hh][ww]+yoko[ww][hh]-1)
     ww range(w) range w ans=max(ans,tate[hh][ww]+yoko[ww][hh]-1) ans max(ans,tate[hh][ww]+yoko[ww][hh]-1) max ans tate[hh][ww]+yoko[ww][hh]-1 tate[hh][ww]+yoko[ww][hh] tate[hh][ww] [hh] tate hh ww yoko[ww][hh] [ww] yoko ww hh 1 print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def input(): return sys.stdin.readline().rstrip() def input(): return sys.stdin.readline().rstrip() input def lamp(arr):
    count = [[] for i in range(len(arr))]
    for i in range(len(arr)):
        lamps = []
        for key, value in groupby(arr[i]):
            n = int(len(list(value)))
            if key == '.':
                lamps += [n]*n
            else:
                lamps += [0]*n
        count[i] = lamps
    return count def lamp(arr):
    count = [[] for i in range(len(arr))]
    for i in range(len(arr)):
        lamps = []
        for key, value in groupby(arr[i]):
            n = int(len(list(value)))
            if key == '.':
                lamps += [n]*n
            else:
                lamps += [0]*n
        count[i] = lamps
    return count lamp def trans(l_2d):
    return [list(x) for x in zip(*l_2d)] def trans(l_2d):
    return [list(x) for x in zip(*l_2d)] trans def main():
    h, w = map(int, input().split())
    s = [list(input()) for i in range(h)]
    tate = lamp(s)
    yoko = lamp(trans(s))
    ans=0
    for hh in range(h):
        for ww in range(w):
            ans=max(ans,tate[hh][ww]+yoko[ww][hh]-1)
    print(ans)
         def main():
    h, w = map(int, input().split())
    s = [list(input()) for i in range(h)]
    tate = lamp(s)
    yoko = lamp(trans(s))
    ans=0
    for hh in range(h):
        for ww in range(w):
            ans=max(ans,tate[hh][ww]+yoko[ww][hh]-1)
    print(ans)
         main
import sys
from itertools import groupby, chain
def input(): return sys.stdin.readline().rstrip()


def trans(l_2d):
    return [list(x) for x in zip(*l_2d)]


def lamp(arr):
    count = [[] for i in range(len(arr))]
    for i in range(len(arr)):
        lamps = []
        for key, value in groupby(arr[i]):
            n = int(len(list(value)))
            if key == '.':
                lamps += [n]*n
            else:
                lamps += [0]*n
        count[i] = lamps
    return count


def main():
    h, w = map(int, input().split())
    s = [list(input()) for i in range(h)]
    tate = lamp(s)
    yoko = lamp(trans(s))
    ans=0
    for hh in range(h):
        for ww in range(w):
            ans=max(ans,tate[hh][ww]+yoko[ww][hh]-1)
    print(ans)
        


if __name__ == '__main__':
    main()
