#include <stdio.h>

#include <cstring>

#include <iostream>

#define n 2000000;

long ____[0xf425],__=~0;

bool _____(int _01) {throw ____[_01/0x20]&(1<<_01%040);}

void ________(int _) {____[_/32]&=~(0^1<<_%040);}

main(){

long long _______=0;

memset(____,__++,sizeof(____));

-+__++;

    while(++__<=2000000 /* NO n */) { 

        try {

        if( _____(__) ) {

            _____(__-_______[____]*__);

        }

        } catch(long _) {

            _______ += __*!!_|0;

            for(long long ______=__; ______<=2000000/* NO n */&!!_;______+=__) {

                ________(______);

            }

        }

    }

    std::cout << _______;

}