B - LCM

Ivan has number b. He is sorting through the numbers aa from 11 to 10181018, and for every aa writes [a,b]a[a,b]a on blackboard. Here [a,b][a,b] stands for least common multiple of aa and bb. Ivan is very lazy, that's why this task bored him soon. But he is interested in how many different numbers he would write on the board if he would finish the task. Help him to find the quantity of different numbers he would write on the board.

Input

The only line contains one integer — bb (1≤b≤1010)(1≤b≤1010).

Output

Print one number — answer for the problem.

Examples

Input

1

Output

1

Input

2

Output

2

Note

In the first example [a,1]=a[a,1]=a, therefore [a,b]a[a,b]a is always equal to 11.

In the second example [a,2][a,2] can be equal to aa or 2⋅a2⋅a depending on parity of aa. [a,b]a[a,b]a can be equal to 11 and 22.

好久没写博客了,结果写博客是因为最近比较水逆,总是头铁。

这道题的意思就是让你求从a到很大一个数的lcm([a,b])/a有多少个不一样的值,然后你的用数论的知识lcm([a,b])/a=b/gcd(a,b);

也就是让你求b的因子个数。

#include<stdio.h>
#include<string.h>
#include<queue>
#include<math.h>
#include<algorithm>
using namespace std;
int main()
{
    long long n;
    scanf("%lld",&n);
    long long m=sqrt(n);
    long long ans=0;
    for(long long i=1; i<=m; i++)
    {
        if(n%i==0)
            ans+=2;
    }
    if(m*m==n)
        ans-=1;
    printf("%lld\n",ans);
    return 0;
}
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值