(let* ((n (read))) (print (modulo (logcount n) 1004535809)))