A new report from the United Nations on ISIS estimates that despite the “defeat” of the group in both Iraq and Syria, somewhere between 20,000 and 30,000 ISIS fighters remain in the two countries, roughly half of them in each.

Having lost all towns and cities, ISIS has mostly sent its fighters into the deserts along the Iraq-Syria border. They are in Anbar Province in Iraq and Deir Ezzor Province in Syria, where the deserts make it easy to cross back and forth at will.

The UN report suggested that a lot of the leadership is being relocated to Afghanistan, where they estimate several thousand ISIS are active, mostly in eastern Afghanistan. In addition, the report suggested a few thousand ISIS are present in Libya.

The report noted ISIS has shown “greater resilience” than expected, and foreign fighters aren’t as inclined to leave the group as was assumed. Instead, a lot of the foreign fighters are being diverted to Afghanistan, where ISIS appears to believe it has more favorable chances.