program abc129d
  implicit none
  character(2000),dimension(:),allocatable :: s
  integer :: h, w, i, j, ans = 0
  integer,dimension(:,:,:),allocatable :: grid

  read *, h, w
  allocate(s(h),grid(w,h,3))
  read *, s

  do i = 1,h
     do j = 1,w
        grid(j,i,:) = merge(0,1,s(i)(j:j)=='#')
     end do
  end do

  do j = 2,w
     grid(j,:,2) = merge(grid(j,:,2)+grid(j-1,:,2),grid(j,:,2),grid(j,:,1)/=0)
  end do

  do j = w-1,1,-1
     grid(j,:,2) = merge(grid(j+1,:,2),grid(j,:,2),grid(j,:,1)/=0.and.grid(j+1,:,1)/=0)
  end do

  do i = 2,h
     grid(:,i,3) = merge(grid(:,i,3)+grid(:,i-1,3),grid(:,i,3),grid(:,i,1)/=0)
  end do

  do i = h-1,1,-1
     grid(:,i,3) = merge(grid(:,i+1,3),grid(:,i,3),grid(:,i,1)/=0.and.grid(:,i+1,1)/=0)
  end do

  do i = 1,h
     do j = 1,w
        if (ans < grid(j,i,2)+grid(j,i,3)) ans = grid(j,i,2)+grid(j,i,3)
     end do
  end do

  print *, ans-1
end program abc129d
