That would work for all positions regardless of legality,
which are in 1-1 correspondence to {0,1,2}^(19*19).<p>The count above is for legal positions only, i.e. those where every connected group of stones is adjacent to an empty point.