h, w = map(int, input().split())
grid = ['#' * (h + 2)]
for _ in range(h):
    grid.append('#' + input() + '#')
grid.append('#' * (h + 2))
lgrid = [[0 for _ in range(w+2)] for _ in range(h+2)]
rgrid = [[0 for _ in range(w+2)] for _ in range(h+2)]
dgrid = [[0 for _ in range(w+2)] for _ in range(h+2)]
ugrid = [[0 for _ in range(w+2)] for _ in range(h+2)]
for i in range(1, h+1):
    for j in range(1, w+1):
        if grid[i][j] == '#':
            lgrid[i][j] = 0
            ugrid[i][j] = 0
        else:
            lgrid[i][j] = lgrid[i][j-1] + 1
            ugrid[i][j] = ugrid[i-1][j] + 1
        if grid[i][w+1-j] == '#':
            rgrid[i][w+1-j] = 0
        else:
            rgrid[i][w+1-j] = rgrid[i][w+2-j] + 1
        if grid[h+1-i][j] == '#':
            dgrid[h+1-i][j] = 0
        else:
            dgrid[h+1-i][j] = dgrid[h+2-i][j] + 1        
cnt = 0
for i in range(1, h+1):
    for j in range(1, w+1):
        tmp = lgrid[i][j]+rgrid[i][j]+ugrid[i][j]+dgrid[i][j] - 3
        cnt = max(cnt, tmp)
print(cnt) h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w grid = ['#' * (h + 2)] grid ['#' * (h + 2)] '#' * (h + 2) '#' h + 2 h 2 for _ in range(h):
    grid.append('#' + input() + '#') _ range(h) range h grid.append('#' + input() + '#') grid.append grid append '#' + input() + '#' '#' + input() '#' input() input '#' grid.append('#' * (h + 2)) grid.append grid append '#' * (h + 2) '#' h + 2 h 2 [0 for _ in range(w+2)] for _ in range(h+2) for _ in range(h+2) _ range(h+2) range h+2 h 2 for _ in range(h+2) [0 for _ in range(w+2)] lgrid = [[0 for _ in range(w+2)] for _ in range(h+2)] lgrid [[0 for _ in range(w+2)] for _ in range(h+2)] [0 for _ in range(w+2)] for _ in range(h+2) for _ in range(h+2) _ range(h+2) range h+2 h 2 for _ in range(h+2) [0 for _ in range(w+2)] rgrid = [[0 for _ in range(w+2)] for _ in range(h+2)] rgrid [[0 for _ in range(w+2)] for _ in range(h+2)] [0 for _ in range(w+2)] for _ in range(h+2) for _ in range(h+2) _ range(h+2) range h+2 h 2 for _ in range(h+2) [0 for _ in range(w+2)] dgrid = [[0 for _ in range(w+2)] for _ in range(h+2)] dgrid [[0 for _ in range(w+2)] for _ in range(h+2)] [0 for _ in range(w+2)] for _ in range(h+2) for _ in range(h+2) _ range(h+2) range h+2 h 2 for _ in range(h+2) [0 for _ in range(w+2)] ugrid = [[0 for _ in range(w+2)] for _ in range(h+2)] ugrid [[0 for _ in range(w+2)] for _ in range(h+2)] for i in range(1, h+1):
    for j in range(1, w+1):
        if grid[i][j] == '#':
            lgrid[i][j] = 0
            ugrid[i][j] = 0
        else:
            lgrid[i][j] = lgrid[i][j-1] + 1
            ugrid[i][j] = ugrid[i-1][j] + 1
        if grid[i][w+1-j] == '#':
            rgrid[i][w+1-j] = 0
        else:
            rgrid[i][w+1-j] = rgrid[i][w+2-j] + 1
        if grid[h+1-i][j] == '#':
            dgrid[h+1-i][j] = 0
        else:
            dgrid[h+1-i][j] = dgrid[h+2-i][j] + 1         i range(1, h+1) range 1 h+1 h 1 for j in range(1, w+1):
        if grid[i][j] == '#':
            lgrid[i][j] = 0
            ugrid[i][j] = 0
        else:
            lgrid[i][j] = lgrid[i][j-1] + 1
            ugrid[i][j] = ugrid[i-1][j] + 1
        if grid[i][w+1-j] == '#':
            rgrid[i][w+1-j] = 0
        else:
            rgrid[i][w+1-j] = rgrid[i][w+2-j] + 1
        if grid[h+1-i][j] == '#':
            dgrid[h+1-i][j] = 0
        else:
            dgrid[h+1-i][j] = dgrid[h+2-i][j] + 1         j range(1, w+1) range 1 w+1 w 1 if grid[i][j] == '#':
            lgrid[i][j] = 0
            ugrid[i][j] = 0
        else:
            lgrid[i][j] = lgrid[i][j-1] + 1
            ugrid[i][j] = ugrid[i-1][j] + 1
         grid[i][j] == '#' grid[i][j] [i] grid i j '#' lgrid[i][j] = 0 lgrid[i][j] [i] lgrid i j 0 ugrid[i][j] = 0 ugrid[i][j] [i] ugrid i j 0 lgrid[i][j] = lgrid[i][j-1] + 1 lgrid[i][j] [i] lgrid i j lgrid[i][j-1] + 1 lgrid[i][j-1] [i] lgrid i j-1 j 1 1 ugrid[i][j] = ugrid[i-1][j] + 1 ugrid[i][j] [i] ugrid i j ugrid[i-1][j] + 1 ugrid[i-1][j] [i-1] ugrid i-1 i 1 j 1 if grid[i][w+1-j] == '#':
            rgrid[i][w+1-j] = 0
        else:
            rgrid[i][w+1-j] = rgrid[i][w+2-j] + 1
         grid[i][w+1-j] == '#' grid[i][w+1-j] [i] grid i w+1-j w+1 w 1 j '#' rgrid[i][w+1-j] = 0 rgrid[i][w+1-j] [i] rgrid i w+1-j w+1 w 1 j 0 rgrid[i][w+1-j] = rgrid[i][w+2-j] + 1 rgrid[i][w+1-j] [i] rgrid i w+1-j w+1 w 1 j rgrid[i][w+2-j] + 1 rgrid[i][w+2-j] [i] rgrid i w+2-j w+2 w 2 j 1 if grid[h+1-i][j] == '#':
            dgrid[h+1-i][j] = 0
        else:
            dgrid[h+1-i][j] = dgrid[h+2-i][j] + 1         grid[h+1-i][j] == '#' grid[h+1-i][j] [h+1-i] grid h+1-i h+1 h 1 i j '#' dgrid[h+1-i][j] = 0 dgrid[h+1-i][j] [h+1-i] dgrid h+1-i h+1 h 1 i j 0 dgrid[h+1-i][j] = dgrid[h+2-i][j] + 1 dgrid[h+1-i][j] [h+1-i] dgrid h+1-i h+1 h 1 i j dgrid[h+2-i][j] + 1 dgrid[h+2-i][j] [h+2-i] dgrid h+2-i h+2 h 2 i j 1 cnt = 0 cnt 0 for i in range(1, h+1):
    for j in range(1, w+1):
        tmp = lgrid[i][j]+rgrid[i][j]+ugrid[i][j]+dgrid[i][j] - 3
        cnt = max(cnt, tmp) i range(1, h+1) range 1 h+1 h 1 for j in range(1, w+1):
        tmp = lgrid[i][j]+rgrid[i][j]+ugrid[i][j]+dgrid[i][j] - 3
        cnt = max(cnt, tmp) j range(1, w+1) range 1 w+1 w 1 tmp = lgrid[i][j]+rgrid[i][j]+ugrid[i][j]+dgrid[i][j] - 3 tmp lgrid[i][j]+rgrid[i][j]+ugrid[i][j]+dgrid[i][j] - 3 lgrid[i][j]+rgrid[i][j]+ugrid[i][j]+dgrid[i][j] lgrid[i][j]+rgrid[i][j]+ugrid[i][j] lgrid[i][j]+rgrid[i][j] lgrid[i][j] [i] lgrid i j rgrid[i][j] [i] rgrid i j ugrid[i][j] [i] ugrid i j dgrid[i][j] [i] dgrid i j 3 cnt = max(cnt, tmp) cnt max(cnt, tmp) max cnt tmp print(cnt) print cnt ugrid = [[0 for _ in range(w+2)] for _ in range(h+2)] [[0 for _ in range(w+2)] for _ in range(h+2)] ugrid cnt = max(cnt, tmp) max(cnt, tmp) cnt w = map(int, input().split()) map(int, input().split()) w grid = ['#' * (h + 2)] ['#' * (h + 2)] grid h, w = map(int, input().split()) map(int, input().split()) h rgrid = [[0 for _ in range(w+2)] for _ in range(h+2)] [[0 for _ in range(w+2)] for _ in range(h+2)] rgrid cnt = 0 0 cnt lgrid = [[0 for _ in range(w+2)] for _ in range(h+2)] [[0 for _ in range(w+2)] for _ in range(h+2)] lgrid tmp = lgrid[i][j]+rgrid[i][j]+ugrid[i][j]+dgrid[i][j] - 3 lgrid[i][j]+rgrid[i][j]+ugrid[i][j]+dgrid[i][j] - 3 tmp dgrid = [[0 for _ in range(w+2)] for _ in range(h+2)] [[0 for _ in range(w+2)] for _ in range(h+2)] dgrid
h, w = map(int, input().split())
grid = ['#' * (h + 2)]
for _ in range(h):
    grid.append('#' + input() + '#')
grid.append('#' * (h + 2))
lgrid = [[0 for _ in range(w+2)] for _ in range(h+2)]
rgrid = [[0 for _ in range(w+2)] for _ in range(h+2)]
dgrid = [[0 for _ in range(w+2)] for _ in range(h+2)]
ugrid = [[0 for _ in range(w+2)] for _ in range(h+2)]
for i in range(1, h+1):
    for j in range(1, w+1):
        if grid[i][j] == '#':
            lgrid[i][j] = 0
            ugrid[i][j] = 0
        else:
            lgrid[i][j] = lgrid[i][j-1] + 1
            ugrid[i][j] = ugrid[i-1][j] + 1
        if grid[i][w+1-j] == '#':
            rgrid[i][w+1-j] = 0
        else:
            rgrid[i][w+1-j] = rgrid[i][w+2-j] + 1
        if grid[h+1-i][j] == '#':
            dgrid[h+1-i][j] = 0
        else:
            dgrid[h+1-i][j] = dgrid[h+2-i][j] + 1        
cnt = 0
for i in range(1, h+1):
    for j in range(1, w+1):
        tmp = lgrid[i][j]+rgrid[i][j]+ugrid[i][j]+dgrid[i][j] - 3
        cnt = max(cnt, tmp)
print(cnt)
