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