Examples of calculating longest loop