target=20000000
s=[0]*(target+1)
f=[0]*(target+1)
phi=[i for i in range(target+1)]
m=100000000
lastBit=lambda x: x&(-x)
def cal(p):
r=0
k=p
while k>0:
r=(r+s[k])%m
k-=lastBit(k)
return r
for i in range(2, target+1):
if phi[i]==i:
for j in range(i,target+1,i):
phi[j]=(phi[j]/i)*(i-1)
for i in range(target,5,-1):
w=(cal(i-1)-cal(phi[i])+1)%m
j=phi[i]
while j < target+1:
s[j]=(s[j]+w)%m
j+=lastBit(j)
f[i]=w
if i%200000==0:print i/200000,"percent to be done"
print f[6]