#include #include #include #include #include #include #include #include #include #include #include #include using ld = long double; using ll = long long int; using ul = unsigned long long int; namespace lamlib { /* constant */ constexpr double epsilon = std::numeric_limits::epsilon(); /* math */ template inline T abs(const T &a){ return (a>0) ? a : -a; } ul inline digit(const ul &num){ return static_cast
    (std::log10(num+epsilon))+1; } /* algorithm */ ul gcd(const ul &a,const ul &b) { return (!b) ? a : gcd(b,a%b); } std::vector eratosthenes(const ul &n) { std::vector prime_candidate(n,true); prime_candidate[0] = prime_candidate[1] = false; for(ul i = 2;i*i < n;++i) { if(!prime_candidate[i]) continue; for(ul j = 2;i*j < n;++j) prime_candidate[i*j] = false; } return prime_candidate; } ll rho_method(const ll &n) { auto f = [&](const ll &xi){ return (xi*xi+1)%n; }; ll x = 2, y = 2, d = 1; while(d == 1) { x = f(x); y = f(f(y)); d = lamlib::gcd(lamlib::abs(x-y),n); } return d; } // 素因数分解(試し割) std::vector prime_factorization_trial(const ll &n) { ll num = n; std::vector prime; for(ll i = 2;i*i <= n;++i) { while((num%i) == 0) { prime.emplace_back(i); num /= i; } } if(num > 1) prime.emplace_back(num); return prime; } /* string */ inline ul same_char_count(const std::string s,const char &ch){ return std::count(std::cbegin(s),std::cend(s),ch); } } // std::cout << std::fixed << std::setprecision(15) << std::endl; int main(int argc,char *argv[]) { std::string p; std::cin >> p; ll count = p.size()-2; ll denominator = std::pow(10, count); ll numerator = std::stof(p) * denominator; if(numerator == 0){ std::cout << 0 << std::endl; return 0; } auto de = lamlib::prime_factorization_trial(denominator); auto nu = lamlib::prime_factorization_trial(numerator); for(ll i = 0;i < de.size();++i) for(ll j = 0;j < nu.size();++j) if(de[i] == nu[j]) { nu[j] = 1; break; } ll ans = 1; for(auto itr = nu.begin();itr != nu.end();++itr) ans *= (*itr); std::cout << ans << std::endl; return 0; }