Replica trick and string winding