program bzoj_2818; var p:array[1..10000000]of longint; prime:array[1..10000000]of boolean; phi:array[1..10000000]of int64; n,i,j,cnt:longint; ans:int64; procedurecalc; begin fillchar(prime,sizeof(prime),true); cnt:=0; for i:=2to n do begin if prime[i] then begin inc(cnt); p[cnt]:=i; phi[i]:=i-1; end; for j:=1to cnt do begin if i*p[j]>n thenbreak; prime[i*p[j]]:=false; if i mod p[j]=0then begin phi[i*p[j]]:=phi[i]*p[j]; break; endelse phi[i*p[j]]:=phi[i]*(p[j]-1); end; end; end; begin readln(n); calc; for i:=2to n do inc(phi[i],phi[i-1]); for i:=1to n do phi[i]:=phi[i]<<1+1; ans:=0; for i:=1to cnt do inc(ans,phi[n div p[i]]); writeln(ans); end.