What is the smallest whole number \(n\) such that four identical T-shaped pieces (as shown below) can be placed inside an \(n\times n\) square grid without overlapping?