Problem of hackerrank

sir this is the question and

this is my code

sir what is the mistake in my code

@qudsiya not taken input corrected