import std.stdio, std.string, std.conv;

enum N = 115000;

immutable hurui = {
    bool[] table = new bool[](N + 1);
    
    table[] = true;
    table[0 .. 2] = false;
    
    for(int i = 2; i * i <= N; ++i){
        for(int j = i + i; j <= N; j += i){
            table[j] = false;
        }
    }
    
    return table;
}();

immutable result = {
    ulong[] result = new ulong[](10001);
    int prime;
    
    foreach(i; 1 .. 10001){
        while(!hurui[prime]) ++prime;
        result[i] = result[i - 1] + prime;
        ++prime;
    }
    
    return result;
}();

void main(string[] args)
{
    foreach(_; 0 .. readln.chomp.to!int){
        result[readln.chomp.to!int].writeln;
    }
}