Found what is wrong

N is not int, but str!!
N =  int(N)  is the answer!