Semiclassical analysis of distinct square partitions