In a twist on finding a needle in a haystack, you need to find the largest contiguous haystack containing exactly one needle. Note that you cannot connect cells on diagonals, only left/right/up/down.
Input
An array (or a number of user input lines, your pick) of 'N'
(needles) and '#'
(hay) characters. Input only contains those two characters, and must contain at least one of each. For example:
N#N#N
#NN##
###N#
N##N#
Output
The size of the largest possible valid haystack. For our example, we would output 11 (there are 11 pieces of hay, and one needle).
#
# ##
###N#
## #
This is code-golf, so shortest code wins. Standard loophole restrictions apply.
Test Cases
Input on left, possible maximal haystack on right
Case 1: 4
N## ##
NN# #
#NN N
#N# #
Case 2: 7
### ###
N#N #
NNN N
### ###
Case 3: 10
N###N ###
#N#N# #N#
#N#N# # #
N###N ###
Case 4: 10
N#N#N
#N#N# # # #
##N## ##N##
#N#N# # # #
N#N#N
Case 5: 1
NN#NN
NNNNN
#NNN# #N
NN#NN