Recursion more than 999 calls are not supported in python implementation, so changed find activation count to iteration