On 30 April 1940, when the gates closed on the ghetto, it housed 163,777 residents. Because of its remarkable productivity, the ghetto managed to survive until August 1944. In the first two years, it absorbed almost 20,000 Jews from liquidated ghettos in nearby Polish towns and villages, as well as 20,000 more from the rest of German-occupied Europe. A total of 210,000 Jews passed through it; but only 877 remained hidden when the Soviets arrived. About 10,000 Jewish residents of Łódź, who used to live there before the invasion of Poland, survived the Holocaust elsewhere.