h,w = map(int,input().split())
c = [[] for i in range(h)]
d = [[1]*w for _ in range(h)]
e = [[1]*w for _ in range(h)]
for i in range(h):
    c[i] = input()
    if c[i][0] == "#":
        d[i][0] = 0
for i in range(w):
    if c[0][i] == "#":
        e[0][i] = 0
    
for i in range(h):
    for j in range(w-1):
        if c[i][j+1] == "#":
            d[i][j+1] = 0
        else:
            d[i][j+1] = d[i][j] + 1
            
for i in range(h-1):
    for j in range(w):
        if c[i+1][j] == "#":
            e[i+1][j] = 0
        else:
            e[i+1][j] = e[i][j] + 1
            
for i in range(h):
    for j in range(w-2,-1,-1):
        if d[i][j] != 0 and d[i][j+1] != 0:
            d[i][j] = d[i][j+1]
        elif d[i][j] != 0 and d[i][j+1] == 0:
            continue
        else:
            d[i][j] = 0
            
for i in range(h-2,-1,-1):
    for j in range(w):
        if e[i][j] != 0 and e[i+1][j] != 0:
            e[i][j] = e[i+1][j]
        elif e[i][j] != 0 and e[i+1][j] == 0:
            continue
        else:
            e[i][j] = 0
            
ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans , d[i][j]+e[i][j])
        
print(ans-1) h,w = map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w [] for i in range(h) for i in range(h) i range(h) range h for i in range(h) [] c = [[] for i in range(h)] c [[] for i in range(h)] [1]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [1]*w [1] 1 w d = [[1]*w for _ in range(h)] d [[1]*w for _ in range(h)] [1]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [1]*w [1] 1 w e = [[1]*w for _ in range(h)] e [[1]*w for _ in range(h)] for i in range(h):
    c[i] = input()
    if c[i][0] == "#":
        d[i][0] = 0 i range(h) range h c[i] = input() c[i] c i input() input if c[i][0] == "#":
        d[i][0] = 0 c[i][0] == "#" c[i][0] [i] c i 0 "#" d[i][0] = 0 d[i][0] [i] d i 0 0 for i in range(w):
    if c[0][i] == "#":
        e[0][i] = 0
     i range(w) range w if c[0][i] == "#":
        e[0][i] = 0
     c[0][i] == "#" c[0][i] [0] c 0 i "#" e[0][i] = 0 e[0][i] [0] e 0 i 0 for i in range(h):
    for j in range(w-1):
        if c[i][j+1] == "#":
            d[i][j+1] = 0
        else:
            d[i][j+1] = d[i][j] + 1
             i range(h) range h for j in range(w-1):
        if c[i][j+1] == "#":
            d[i][j+1] = 0
        else:
            d[i][j+1] = d[i][j] + 1
             j range(w-1) range w-1 w 1 if c[i][j+1] == "#":
            d[i][j+1] = 0
        else:
            d[i][j+1] = d[i][j] + 1
             c[i][j+1] == "#" c[i][j+1] [i] c i j+1 j 1 "#" d[i][j+1] = 0 d[i][j+1] [i] d i j+1 j 1 0 d[i][j+1] = d[i][j] + 1 d[i][j+1] [i] d i j+1 j 1 d[i][j] + 1 d[i][j] [i] d i j 1 for i in range(h-1):
    for j in range(w):
        if c[i+1][j] == "#":
            e[i+1][j] = 0
        else:
            e[i+1][j] = e[i][j] + 1
             i range(h-1) range h-1 h 1 for j in range(w):
        if c[i+1][j] == "#":
            e[i+1][j] = 0
        else:
            e[i+1][j] = e[i][j] + 1
             j range(w) range w if c[i+1][j] == "#":
            e[i+1][j] = 0
        else:
            e[i+1][j] = e[i][j] + 1
             c[i+1][j] == "#" c[i+1][j] [i+1] c i+1 i 1 j "#" e[i+1][j] = 0 e[i+1][j] [i+1] e i+1 i 1 j 0 e[i+1][j] = e[i][j] + 1 e[i+1][j] [i+1] e i+1 i 1 j e[i][j] + 1 e[i][j] [i] e i j 1 for i in range(h):
    for j in range(w-2,-1,-1):
        if d[i][j] != 0 and d[i][j+1] != 0:
            d[i][j] = d[i][j+1]
        elif d[i][j] != 0 and d[i][j+1] == 0:
            continue
        else:
            d[i][j] = 0
             i range(h) range h for j in range(w-2,-1,-1):
        if d[i][j] != 0 and d[i][j+1] != 0:
            d[i][j] = d[i][j+1]
        elif d[i][j] != 0 and d[i][j+1] == 0:
            continue
        else:
            d[i][j] = 0
             j range(w-2,-1,-1) range w-2 w 2 -1 -1 if d[i][j] != 0 and d[i][j+1] != 0:
            d[i][j] = d[i][j+1]
        elif d[i][j] != 0 and d[i][j+1] == 0:
            continue
        else:
            d[i][j] = 0
             d[i][j] != 0 and d[i][j+1] != 0 d[i][j] != 0 d[i][j] [i] d i j 0 d[i][j+1] != 0 d[i][j+1] [i] d i j+1 j 1 0 d[i][j] = d[i][j+1] d[i][j] [i] d i j d[i][j+1] [i] d i j+1 j 1 elif d[i][j] != 0 and d[i][j+1] == 0:
            continue
         d[i][j] != 0 and d[i][j+1] == 0 d[i][j] != 0 d[i][j] [i] d i j 0 d[i][j+1] == 0 d[i][j+1] [i] d i j+1 j 1 0 continue d[i][j] = 0 d[i][j] [i] d i j 0 for i in range(h-2,-1,-1):
    for j in range(w):
        if e[i][j] != 0 and e[i+1][j] != 0:
            e[i][j] = e[i+1][j]
        elif e[i][j] != 0 and e[i+1][j] == 0:
            continue
        else:
            e[i][j] = 0
             i range(h-2,-1,-1) range h-2 h 2 -1 -1 for j in range(w):
        if e[i][j] != 0 and e[i+1][j] != 0:
            e[i][j] = e[i+1][j]
        elif e[i][j] != 0 and e[i+1][j] == 0:
            continue
        else:
            e[i][j] = 0
             j range(w) range w if e[i][j] != 0 and e[i+1][j] != 0:
            e[i][j] = e[i+1][j]
        elif e[i][j] != 0 and e[i+1][j] == 0:
            continue
        else:
            e[i][j] = 0
             e[i][j] != 0 and e[i+1][j] != 0 e[i][j] != 0 e[i][j] [i] e i j 0 e[i+1][j] != 0 e[i+1][j] [i+1] e i+1 i 1 j 0 e[i][j] = e[i+1][j] e[i][j] [i] e i j e[i+1][j] [i+1] e i+1 i 1 j elif e[i][j] != 0 and e[i+1][j] == 0:
            continue
         e[i][j] != 0 and e[i+1][j] == 0 e[i][j] != 0 e[i][j] [i] e i j 0 e[i+1][j] == 0 e[i+1][j] [i+1] e i+1 i 1 j 0 continue e[i][j] = 0 e[i][j] [i] e i j 0 ans = 0 ans 0 for i in range(h):
    for j in range(w):
        ans = max(ans , d[i][j]+e[i][j])
         i range(h) range h for j in range(w):
        ans = max(ans , d[i][j]+e[i][j])
         j range(w) range w ans = max(ans , d[i][j]+e[i][j]) ans max(ans , d[i][j]+e[i][j]) max ans d[i][j]+e[i][j] d[i][j] [i] d i j e[i][j] [i] e i j print(ans-1) print ans-1 ans 1 e = [[1]*w for _ in range(h)] [[1]*w for _ in range(h)] e ans = 0 0 ans h,w = map(int,input().split()) map(int,input().split()) h c = [[] for i in range(h)] [[] for i in range(h)] c w = map(int,input().split()) map(int,input().split()) w ans = max(ans , d[i][j]+e[i][j]) max(ans , d[i][j]+e[i][j]) ans d = [[1]*w for _ in range(h)] [[1]*w for _ in range(h)] d
h,w = map(int,input().split())
c = [[] for i in range(h)]
d = [[1]*w for _ in range(h)]
e = [[1]*w for _ in range(h)]
for i in range(h):
    c[i] = input()
    if c[i][0] == "#":
        d[i][0] = 0
for i in range(w):
    if c[0][i] == "#":
        e[0][i] = 0
    
for i in range(h):
    for j in range(w-1):
        if c[i][j+1] == "#":
            d[i][j+1] = 0
        else:
            d[i][j+1] = d[i][j] + 1
            
for i in range(h-1):
    for j in range(w):
        if c[i+1][j] == "#":
            e[i+1][j] = 0
        else:
            e[i+1][j] = e[i][j] + 1
            
for i in range(h):
    for j in range(w-2,-1,-1):
        if d[i][j] != 0 and d[i][j+1] != 0:
            d[i][j] = d[i][j+1]
        elif d[i][j] != 0 and d[i][j+1] == 0:
            continue
        else:
            d[i][j] = 0
            
for i in range(h-2,-1,-1):
    for j in range(w):
        if e[i][j] != 0 and e[i+1][j] != 0:
            e[i][j] = e[i+1][j]
        elif e[i][j] != 0 and e[i+1][j] == 0:
            continue
        else:
            e[i][j] = 0
            
ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans , d[i][j]+e[i][j])
        
print(ans-1)