Help ramu incorrect output problem

the answer is coming 1 less than what it should come,
pls help