while 1:l=list(input());print(+(l==sorted(l)))