@data = nil

def solve(n, x, y)
#  printf "solve X=%d Y=%d\n", x, y
  return 0 if @data[y][x] == '*'

  length = 1
  (n-x).step(2, -1) do |l|
#    printf "length=%d", l
#    p isSquare(n, x, y ,l)
    if isSquare(n, x, y ,l)
      if(length < l)
        length = l
      else
        break
      end
    end
  end
  length
end

def isSquare(n, x, y, length)
  return false if y + length > n
#
#  (y...y+length).each do |j|
#    (x...x+length).each do |i|
#      return false if @data[j][i] == '*'
#    end
#  end
  true
end

while (n = $stdin.gets.to_i) != 0 do
  @data = Array.new
  n.times do
    @data << $stdin.gets.chomp
  end

  length = 0
  n.times do |y|
    n.times do |x|
      length = [length, solve(n, x, y)].max if @data[y][x] == '.'
    end
  end

  p length
end

#def solve(n, x, y)
#  return 0 if @data[x][y] == '*'
#
#  length = 1
#  (x+1...n).each do |i|
#    if isSquare(n, x, y ,i - x + 1)
#      length = i - x + 1
#    else
#      break
#    end
#  end
#  length
#end

#def isSquare(n, x, y, length)
#  return false if x + length > n || y + length > n
#
#  #x軸チェック
#  (x...x+length).each do |i|
#    return false if @data[i][y + length - 1] == '*'
#  end
#  #y軸チェック
#  (y...y+length).each do |j|
#    return false if @data[x + length - 1][j] == '*'
#  end
#
#  true
#end