#include typedef uint64_t u64; typedef int64_t i64; using namespace std; template struct modint{ u64 val; modint(i64 val_=0):val((val_%i64(mod)+i64(mod))%i64(mod)){} modint operator-(){ return (val==0)?0:mod-val; } modint operator+(modint rhs){ return modint(*this)+=rhs; } modint operator-(modint rhs){ return modint(*this)-=rhs; } modint operator*(modint rhs){ return modint(*this)*=rhs; } modint operator/(modint rhs){ return modint(*this)/=rhs; } modint pow(i64 rhs){ modint res=1,now=(*this); while(rhs){ res*=((rhs&1)?now:1),now*=now,rhs>>=1; } return res; } modint &operator+=(modint rhs){ val+=rhs.val,val-=((val>=mod)?mod:0); return (*this); } modint &operator-=(modint rhs){ val+=((val>(std::istream& is,modint& x){ u64 t; is>>t,x=t; return is; } }; int main(){ constexpr u64 mod=1000000007; typedef modint mint; int N; cin>>N; vector div; for(int i=1;i*i<=N;++i){ if(N%i!=0){ continue; } div.emplace_back(i); if(i*i!=N){ div.emplace_back(N/i); } } int ans=0; for(auto v:div){ int u=N/v; if((u&v)==u){ ans+=(1<<__builtin_popcount(u)); } } cout<