import math
# 分解质因数
def devide_prime(val):
ans = []
for i in range(2, int(math.sqrt(val)) + 1):
if val % i == 0:
cnt = 0
while val % i == 0:
val //= i
cnt += 1
ans.append((i, cnt))
if val == 1:
break
if val != 1:
ans.append((val, 1))
return ans
def gcd(a, b):
if a > b:
a, b, = b, a
while a:
a, b = b % a, a
return b
N = int(input())
tot = 1
a, b = N, 1
for p, alpha in devide_prime(N):
a *= (1+alpha)*p - alpha
b *= p
gcd_val = gcd(a, b)
a, b = a // gcd_val, b // gcd_val
print(a)
为啥要乘d d不是枚举的嘛