import math
n=10**12
m=10**8
bound=10**6
def f(n,d):
b=math.isqrt(n//d)
s=sum(n//d//k for k in range(d+1,b+1)) if d < b else n//d//(d+1)
d2=max(b,d+1)
p=d2
for k in range(n//d//d2,0,-1):
x=n//d//k
s+=(x-p)*k
p=x
return 2*s+n//d//d
print((sum((n//d-1)*(n//(d+1)) for d in range(1,bound+1))+sum(((n//d-n//(d+1))*(d-1)*d-d+1) for d in range(1,bound))-sum(f(n,d) for d in range(2,bound+1)))%m)