n=int(input()) a=[0,0,0] p=0 for i in range(33): if (n>>i)&1: a[p]|=1<