#!/usr/bin/env python
# coding: utf-8

# In[1]:


import numpy as np


# In[2]:


H, W = map(int, input().split())
S = np.ones((H, W), dtype=np.bool)
for i in range(H):
    S[i] = [s == "." for s in input()]


# In[3]:


up = np.zeros((H, W), dtype=np.int16)
down = np.zeros((H, W), dtype=np.int16)
left = np.zeros((H, W), dtype=np.int16)
right = np.zeros((H, W), dtype=np.int16)

# up
up[0, :] = S[0, :]
for h in range(1, H):
    up[h, :] = up[h - 1, :] + 1
    up[h, :] *= S[h, :]

# down
down[H - 1, :] = S[H - 1, :]
for h in reversed(range(0, H - 1)):
    down[h, :] = down[h + 1, :] + 1
    down[h, :] *= S[h, :]

# left
left[:, 0] = S[:, 0]
for w in range(1, W):
    left[:, w] = left[:, w - 1] + 1
    left[:, w] *= S[:, w]

# right
right[:, W - 1] = S[:, W - 1]
for w in reversed(range(0, W - 1)):
    right[:, w] = right[:, w + 1] + 1
    right[:, w] *= S[:, w]

ans = np.max(up + down + left + right - 3)
print(ans)


# In[ ]:



 import numpy as np numpy H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W S = np.ones((H, W), dtype=np.bool) S np.ones((H, W), dtype=np.bool) np.ones np ones (H, W) H W dtype=np.bool dtype np.bool np bool for i in range(H):
    S[i] = [s == "." for s in input()]


# In[3]: i range(H) range H s == "." for s in input() for s in input() s input() input for s in input() s == "." s "." S[i] = [s == "." for s in input()] S[i] S i [s == "." for s in input()] up = np.zeros((H, W), dtype=np.int16) up np.zeros((H, W), dtype=np.int16) np.zeros np zeros (H, W) H W dtype=np.int16 dtype np.int16 np int16 down = np.zeros((H, W), dtype=np.int16) down np.zeros((H, W), dtype=np.int16) np.zeros np zeros (H, W) H W dtype=np.int16 dtype np.int16 np int16 left = np.zeros((H, W), dtype=np.int16) left np.zeros((H, W), dtype=np.int16) np.zeros np zeros (H, W) H W dtype=np.int16 dtype np.int16 np int16 right = np.zeros((H, W), dtype=np.int16) right np.zeros((H, W), dtype=np.int16) np.zeros np zeros (H, W) H W dtype=np.int16 dtype np.int16 np int16 up[0, :] = S[0, :] up[0, :] up 0 S[0, :] S 0 for h in range(1, H):
    up[h, :] = up[h - 1, :] + 1
    up[h, :] *= S[h, :]

# down h range(1, H) range 1 H up[h, :] = up[h - 1, :] + 1 up[h, :] up h up[h - 1, :] + 1 up[h - 1, :] up h - 1 h 1 1 up[h, :] *= S[h, :] up[h, :] up h S[h, :] S h down[H - 1, :] = S[H - 1, :] down[H - 1, :] down H - 1 H 1 S[H - 1, :] S H - 1 H 1 for h in reversed(range(0, H - 1)):
    down[h, :] = down[h + 1, :] + 1
    down[h, :] *= S[h, :]

# left h reversed(range(0, H - 1)) reversed range(0, H - 1) range 0 H - 1 H 1 down[h, :] = down[h + 1, :] + 1 down[h, :] down h down[h + 1, :] + 1 down[h + 1, :] down h + 1 h 1 1 down[h, :] *= S[h, :] down[h, :] down h S[h, :] S h left[:, 0] = S[:, 0] left[:, 0] left : S[:, 0] S : for w in range(1, W):
    left[:, w] = left[:, w - 1] + 1
    left[:, w] *= S[:, w]

# right w range(1, W) range 1 W left[:, w] = left[:, w - 1] + 1 left[:, w] left : left[:, w - 1] + 1 left[:, w - 1] left : 1 left[:, w] *= S[:, w] left[:, w] left : S[:, w] S : right[:, W - 1] = S[:, W - 1] right[:, W - 1] right : S[:, W - 1] S : for w in reversed(range(0, W - 1)):
    right[:, w] = right[:, w + 1] + 1
    right[:, w] *= S[:, w] w reversed(range(0, W - 1)) reversed range(0, W - 1) range 0 W - 1 W 1 right[:, w] = right[:, w + 1] + 1 right[:, w] right : right[:, w + 1] + 1 right[:, w + 1] right : 1 right[:, w] *= S[:, w] right[:, w] right : S[:, w] S : ans = np.max(up + down + left + right - 3) ans np.max(up + down + left + right - 3) np.max np max up + down + left + right - 3 up + down + left + right up + down + left up + down up down left right 3 print(ans) print ans up = np.zeros((H, W), dtype=np.int16) np.zeros((H, W), dtype=np.int16) up down = np.zeros((H, W), dtype=np.int16) np.zeros((H, W), dtype=np.int16) down ans = np.max(up + down + left + right - 3) np.max(up + down + left + right - 3) ans W = map(int, input().split()) map(int, input().split()) W H, W = map(int, input().split()) map(int, input().split()) H S = np.ones((H, W), dtype=np.bool) np.ones((H, W), dtype=np.bool) S left = np.zeros((H, W), dtype=np.int16) np.zeros((H, W), dtype=np.int16) left right = np.zeros((H, W), dtype=np.int16) np.zeros((H, W), dtype=np.int16) right
#!/usr/bin/env python
# coding: utf-8

# In[1]:


import numpy as np


# In[2]:


H, W = map(int, input().split())
S = np.ones((H, W), dtype=np.bool)
for i in range(H):
    S[i] = [s == "." for s in input()]


# In[3]:


up = np.zeros((H, W), dtype=np.int16)
down = np.zeros((H, W), dtype=np.int16)
left = np.zeros((H, W), dtype=np.int16)
right = np.zeros((H, W), dtype=np.int16)

# up
up[0, :] = S[0, :]
for h in range(1, H):
    up[h, :] = up[h - 1, :] + 1
    up[h, :] *= S[h, :]

# down
down[H - 1, :] = S[H - 1, :]
for h in reversed(range(0, H - 1)):
    down[h, :] = down[h + 1, :] + 1
    down[h, :] *= S[h, :]

# left
left[:, 0] = S[:, 0]
for w in range(1, W):
    left[:, w] = left[:, w - 1] + 1
    left[:, w] *= S[:, w]

# right
right[:, W - 1] = S[:, W - 1]
for w in reversed(range(0, W - 1)):
    right[:, w] = right[:, w + 1] + 1
    right[:, w] *= S[:, w]

ans = np.max(up + down + left + right - 3)
print(ans)


# In[ ]:




