Run-Time error in Pair of roses problem

I am unable to understand why ide is giving run-time error. In my opinion my code is correct.