Solved Sherlock and squares