k=int(input()) a=k//100 b=k//10-a*10 c=k-a*100-b*10 if a==c or a==b or b==c: print('1') else: print('0')
1