import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np
# from numpy import cumsum  # accumulate

def solve():
    H, W = MI()
    G = LLS(H)

    R = [[] for _ in range(H)]
    for i, row in enumerate(G):
        tmp = [0] * (W+1)
        cnt = 0
        flag = True
        idx = -1
        # print(row)
        for j, h in enumerate(row):
            if h == '#':
                if cnt > 0:
                    tmp[idx] = tmp[idx] + cnt
                    tmp[j] = tmp[j] - cnt
                    cnt = 0
                    flag = True
            else:
                if flag:
                    idx = j
                    flag = False
                cnt = cnt + 1
        if cnt > 0:
            tmp[idx] = tmp[idx] + cnt
            tmp[-1] = - cnt

        # print(tmp)
        # print(*accumulate(tmp))
        R[i] = list(accumulate(tmp))
    # print(R)

    ans = -1
    for i in range(W):
        tmp2 = [0] * (H+1)
        cnt = 0
        flag2 = True
        idx = -1
        for j in range(H):
            d = G[j][i]
            if d == '#':
                if cnt > 0:
                    tmp2[idx] = cnt
                    tmp2[j] = - cnt
                    cnt = 0
                    flag2 = True
            else:
                if flag2:
                    idx = j
                    flag2 = False
                cnt = cnt + 1
        if cnt > 0:
            tmp2[idx] = cnt
            tmp2[-1] = - cnt
        # print(tmp2)
        # print(*accumulate(tmp2))
        for j, a in enumerate(list(accumulate(tmp2))[:-1]):
            ans = max(ans, R[j][i] + a - 1)

    print(ans)



if __name__ == '__main__':
    solve() import sys sys sys.setrecursionlimit(10 ** 9) sys.setrecursionlimit sys setrecursionlimit 10 ** 9 10 9 def int1(x): return int(x) - 1 int1 x x def II(): return int(input()) II def MI(): return map(int, input().split()) MI def MI1(): return map(int1, input().split()) MI1 def LI(): return list(map(int, input().split())) LI def LI1(): return list(map(int1, input().split())) LI1 LI() for _ in range(rows_number) for _ in range(rows_number) _ range(rows_number) range rows_number for _ in range(rows_number) LI() LI def LLI(rows_number): return [LI() for _ in range(rows_number)] LLI rows_number rows_number def MS(): return input().split() MS def LS(): return list(input()) LS LS() for _ in range(rows_number) for _ in range(rows_number) _ range(rows_number) range rows_number for _ in range(rows_number) LS() LS def LLS(rows_number): return [LS() for _ in range(rows_number)] LLS rows_number rows_number def printlist(lst, k=' '): print(k.join(list(map(str, lst)))) printlist lst lst k=' ' k ' ' INF = float('inf') INF float('inf') float 'inf' from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations def solve():
    H, W = MI()
    G = LLS(H)

    R = [[] for _ in range(H)]
    for i, row in enumerate(G):
        tmp = [0] * (W+1)
        cnt = 0
        flag = True
        idx = -1
        # print(row)
        for j, h in enumerate(row):
            if h == '#':
                if cnt > 0:
                    tmp[idx] = tmp[idx] + cnt
                    tmp[j] = tmp[j] - cnt
                    cnt = 0
                    flag = True
            else:
                if flag:
                    idx = j
                    flag = False
                cnt = cnt + 1
        if cnt > 0:
            tmp[idx] = tmp[idx] + cnt
            tmp[-1] = - cnt

        # print(tmp)
        # print(*accumulate(tmp))
        R[i] = list(accumulate(tmp))
    # print(R)

    ans = -1
    for i in range(W):
        tmp2 = [0] * (H+1)
        cnt = 0
        flag2 = True
        idx = -1
        for j in range(H):
            d = G[j][i]
            if d == '#':
                if cnt > 0:
                    tmp2[idx] = cnt
                    tmp2[j] = - cnt
                    cnt = 0
                    flag2 = True
            else:
                if flag2:
                    idx = j
                    flag2 = False
                cnt = cnt + 1
        if cnt > 0:
            tmp2[idx] = cnt
            tmp2[-1] = - cnt
        # print(tmp2)
        # print(*accumulate(tmp2))
        for j, a in enumerate(list(accumulate(tmp2))[:-1]):
            ans = max(ans, R[j][i] + a - 1)

    print(ans) solve H, W = MI() H MI() MI W G = LLS(H) G LLS(H) LLS H [] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [] R = [[] for _ in range(H)] R [[] for _ in range(H)] for i, row in enumerate(G):
        tmp = [0] * (W+1)
        cnt = 0
        flag = True
        idx = -1
        # print(row)
        for j, h in enumerate(row):
            if h == '#':
                if cnt > 0:
                    tmp[idx] = tmp[idx] + cnt
                    tmp[j] = tmp[j] - cnt
                    cnt = 0
                    flag = True
            else:
                if flag:
                    idx = j
                    flag = False
                cnt = cnt + 1
        if cnt > 0:
            tmp[idx] = tmp[idx] + cnt
            tmp[-1] = - cnt

        # print(tmp)
        # print(*accumulate(tmp))
        R[i] = list(accumulate(tmp))
    # print(R)

     i row enumerate(G) enumerate G tmp = [0] * (W+1) tmp [0] * (W+1) [0] 0 W+1 W 1 cnt = 0 cnt 0 flag = True flag True idx = -1 idx -1 for j, h in enumerate(row):
            if h == '#':
                if cnt > 0:
                    tmp[idx] = tmp[idx] + cnt
                    tmp[j] = tmp[j] - cnt
                    cnt = 0
                    flag = True
            else:
                if flag:
                    idx = j
                    flag = False
                cnt = cnt + 1
         j h enumerate(row) enumerate row if h == '#':
                if cnt > 0:
                    tmp[idx] = tmp[idx] + cnt
                    tmp[j] = tmp[j] - cnt
                    cnt = 0
                    flag = True
            else:
                if flag:
                    idx = j
                    flag = False
                cnt = cnt + 1
         h == '#' h '#' if cnt > 0:
                    tmp[idx] = tmp[idx] + cnt
                    tmp[j] = tmp[j] - cnt
                    cnt = 0
                    flag = True
             cnt > 0 cnt 0 tmp[idx] = tmp[idx] + cnt tmp[idx] tmp idx tmp[idx] + cnt tmp[idx] tmp idx cnt tmp[j] = tmp[j] - cnt tmp[j] tmp j tmp[j] - cnt tmp[j] tmp j cnt cnt = 0 cnt 0 flag = True flag True if flag:
                    idx = j
                    flag = False
                 flag idx = j idx j flag = False flag False cnt = cnt + 1 cnt cnt + 1 cnt 1 if cnt > 0:
            tmp[idx] = tmp[idx] + cnt
            tmp[-1] = - cnt

        # print(tmp)
        # print(*accumulate(tmp))
         cnt > 0 cnt 0 tmp[idx] = tmp[idx] + cnt tmp[idx] tmp idx tmp[idx] + cnt tmp[idx] tmp idx cnt tmp[-1] = - cnt tmp[-1] tmp -1 - cnt cnt R[i] = list(accumulate(tmp)) R[i] R i list(accumulate(tmp)) list accumulate(tmp) accumulate tmp ans = -1 ans -1 for i in range(W):
        tmp2 = [0] * (H+1)
        cnt = 0
        flag2 = True
        idx = -1
        for j in range(H):
            d = G[j][i]
            if d == '#':
                if cnt > 0:
                    tmp2[idx] = cnt
                    tmp2[j] = - cnt
                    cnt = 0
                    flag2 = True
            else:
                if flag2:
                    idx = j
                    flag2 = False
                cnt = cnt + 1
        if cnt > 0:
            tmp2[idx] = cnt
            tmp2[-1] = - cnt
        # print(tmp2)
        # print(*accumulate(tmp2))
        for j, a in enumerate(list(accumulate(tmp2))[:-1]):
            ans = max(ans, R[j][i] + a - 1)

     i range(W) range W tmp2 = [0] * (H+1) tmp2 [0] * (H+1) [0] 0 H+1 H 1 cnt = 0 cnt 0 flag2 = True flag2 True idx = -1 idx -1 for j in range(H):
            d = G[j][i]
            if d == '#':
                if cnt > 0:
                    tmp2[idx] = cnt
                    tmp2[j] = - cnt
                    cnt = 0
                    flag2 = True
            else:
                if flag2:
                    idx = j
                    flag2 = False
                cnt = cnt + 1
         j range(H) range H d = G[j][i] d G[j][i] [j] G j i if d == '#':
                if cnt > 0:
                    tmp2[idx] = cnt
                    tmp2[j] = - cnt
                    cnt = 0
                    flag2 = True
            else:
                if flag2:
                    idx = j
                    flag2 = False
                cnt = cnt + 1
         d == '#' d '#' if cnt > 0:
                    tmp2[idx] = cnt
                    tmp2[j] = - cnt
                    cnt = 0
                    flag2 = True
             cnt > 0 cnt 0 tmp2[idx] = cnt tmp2[idx] tmp2 idx cnt tmp2[j] = - cnt tmp2[j] tmp2 j - cnt cnt cnt = 0 cnt 0 flag2 = True flag2 True if flag2:
                    idx = j
                    flag2 = False
                 flag2 idx = j idx j flag2 = False flag2 False cnt = cnt + 1 cnt cnt + 1 cnt 1 if cnt > 0:
            tmp2[idx] = cnt
            tmp2[-1] = - cnt
        # print(tmp2)
        # print(*accumulate(tmp2))
         cnt > 0 cnt 0 tmp2[idx] = cnt tmp2[idx] tmp2 idx cnt tmp2[-1] = - cnt tmp2[-1] tmp2 -1 - cnt cnt for j, a in enumerate(list(accumulate(tmp2))[:-1]):
            ans = max(ans, R[j][i] + a - 1)

     j a enumerate(list(accumulate(tmp2))[:-1]) enumerate list(accumulate(tmp2))[:-1] (accumulate(tmp2)) list accumulate(tmp2) accumulate tmp2 :-1 -1 ans = max(ans, R[j][i] + a - 1) ans max(ans, R[j][i] + a - 1) max ans R[j][i] + a - 1 R[j][i] + a R[j][i] [j] R j i a 1 print(ans) print ans if __name__ == '__main__':
    solve() __name__ == '__main__' __name__ '__main__' solve() solve def MI(): return map(int, input().split()) def MI(): return map(int, input().split()) MI def MI1(): return map(int1, input().split()) def MI1(): return map(int1, input().split()) MI1 def MS(): return input().split() def MS(): return input().split() MS def LI(): return list(map(int, input().split())) def LI(): return list(map(int, input().split())) LI def solve():
    H, W = MI()
    G = LLS(H)

    R = [[] for _ in range(H)]
    for i, row in enumerate(G):
        tmp = [0] * (W+1)
        cnt = 0
        flag = True
        idx = -1
        # print(row)
        for j, h in enumerate(row):
            if h == '#':
                if cnt > 0:
                    tmp[idx] = tmp[idx] + cnt
                    tmp[j] = tmp[j] - cnt
                    cnt = 0
                    flag = True
            else:
                if flag:
                    idx = j
                    flag = False
                cnt = cnt + 1
        if cnt > 0:
            tmp[idx] = tmp[idx] + cnt
            tmp[-1] = - cnt

        # print(tmp)
        # print(*accumulate(tmp))
        R[i] = list(accumulate(tmp))
    # print(R)

    ans = -1
    for i in range(W):
        tmp2 = [0] * (H+1)
        cnt = 0
        flag2 = True
        idx = -1
        for j in range(H):
            d = G[j][i]
            if d == '#':
                if cnt > 0:
                    tmp2[idx] = cnt
                    tmp2[j] = - cnt
                    cnt = 0
                    flag2 = True
            else:
                if flag2:
                    idx = j
                    flag2 = False
                cnt = cnt + 1
        if cnt > 0:
            tmp2[idx] = cnt
            tmp2[-1] = - cnt
        # print(tmp2)
        # print(*accumulate(tmp2))
        for j, a in enumerate(list(accumulate(tmp2))[:-1]):
            ans = max(ans, R[j][i] + a - 1)

    print(ans) def solve():
    H, W = MI()
    G = LLS(H)

    R = [[] for _ in range(H)]
    for i, row in enumerate(G):
        tmp = [0] * (W+1)
        cnt = 0
        flag = True
        idx = -1
        # print(row)
        for j, h in enumerate(row):
            if h == '#':
                if cnt > 0:
                    tmp[idx] = tmp[idx] + cnt
                    tmp[j] = tmp[j] - cnt
                    cnt = 0
                    flag = True
            else:
                if flag:
                    idx = j
                    flag = False
                cnt = cnt + 1
        if cnt > 0:
            tmp[idx] = tmp[idx] + cnt
            tmp[-1] = - cnt

        # print(tmp)
        # print(*accumulate(tmp))
        R[i] = list(accumulate(tmp))
    # print(R)

    ans = -1
    for i in range(W):
        tmp2 = [0] * (H+1)
        cnt = 0
        flag2 = True
        idx = -1
        for j in range(H):
            d = G[j][i]
            if d == '#':
                if cnt > 0:
                    tmp2[idx] = cnt
                    tmp2[j] = - cnt
                    cnt = 0
                    flag2 = True
            else:
                if flag2:
                    idx = j
                    flag2 = False
                cnt = cnt + 1
        if cnt > 0:
            tmp2[idx] = cnt
            tmp2[-1] = - cnt
        # print(tmp2)
        # print(*accumulate(tmp2))
        for j, a in enumerate(list(accumulate(tmp2))[:-1]):
            ans = max(ans, R[j][i] + a - 1)

    print(ans) solve INF = float('inf') float('inf') INF def II(): return int(input()) def II(): return int(input()) II def LLI(rows_number): return [LI() for _ in range(rows_number)] def LLI(rows_number): return [LI() for _ in range(rows_number)] LLI def LS(): return list(input()) def LS(): return list(input()) LS def printlist(lst, k=' '): print(k.join(list(map(str, lst)))) def printlist(lst, k=' '): print(k.join(list(map(str, lst)))) printlist def int1(x): return int(x) - 1 def int1(x): return int(x) - 1 int1 def LI1(): return list(map(int1, input().split())) def LI1(): return list(map(int1, input().split())) LI1 def LLS(rows_number): return [LS() for _ in range(rows_number)] def LLS(rows_number): return [LS() for _ in range(rows_number)] LLS
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np
# from numpy import cumsum  # accumulate

def solve():
    H, W = MI()
    G = LLS(H)

    R = [[] for _ in range(H)]
    for i, row in enumerate(G):
        tmp = [0] * (W+1)
        cnt = 0
        flag = True
        idx = -1
        # print(row)
        for j, h in enumerate(row):
            if h == '#':
                if cnt > 0:
                    tmp[idx] = tmp[idx] + cnt
                    tmp[j] = tmp[j] - cnt
                    cnt = 0
                    flag = True
            else:
                if flag:
                    idx = j
                    flag = False
                cnt = cnt + 1
        if cnt > 0:
            tmp[idx] = tmp[idx] + cnt
            tmp[-1] = - cnt

        # print(tmp)
        # print(*accumulate(tmp))
        R[i] = list(accumulate(tmp))
    # print(R)

    ans = -1
    for i in range(W):
        tmp2 = [0] * (H+1)
        cnt = 0
        flag2 = True
        idx = -1
        for j in range(H):
            d = G[j][i]
            if d == '#':
                if cnt > 0:
                    tmp2[idx] = cnt
                    tmp2[j] = - cnt
                    cnt = 0
                    flag2 = True
            else:
                if flag2:
                    idx = j
                    flag2 = False
                cnt = cnt + 1
        if cnt > 0:
            tmp2[idx] = cnt
            tmp2[-1] = - cnt
        # print(tmp2)
        # print(*accumulate(tmp2))
        for j, a in enumerate(list(accumulate(tmp2))[:-1]):
            ans = max(ans, R[j][i] + a - 1)

    print(ans)



if __name__ == '__main__':
    solve()
