Wrote CalculateFactorialChainLength().
Fix merge conflicts.