where  is the total entropy change in the external thermal reservoirs (surroundings),  is an infinitesimal amount of heat that is taken from the reservoirs and absorbed by the system ( if heat from the reservoirs is absorbed by the system, and  < 0 if heat is leaving from the system to the reservoirs) and  is the common temperature of the reservoirs at a particular instant in time.
The total entropy change in the surroundings is a tiny amount of heat transferred from the surroundings to the system.  If heat flows out of the system into the surroundings, the entropy change will be negative.