fork download
  1. # your code goes here
  2. arr=list(map(int,input().split()))
  3. res=ans=set()
  4. for x in arr:
  5. ans={x|i for i in ans}|{x}
  6. res|=ans
  7. print(len(res),end="")
Success #stdin #stdout 0.03s 9824KB
stdin
1 2 4
stdout
6