NZEC error in python

I have written a code in python, it seems to work on spyder, but it is giving syntax error when taking input in the in-built ide, though my solution is correct it is not accepted (I am not giving blank input in the in-built ide)

please link your solution