Algebra  K12A cube is painted on the outside and then divided into one-unit cubes. The total number of painted faces equals the total number of unpainted faces.

What was the side length of the cube before it was painted?