#[macro_export]
macro_rules !read_value {($iter :expr ,($($t :tt ) ,*) ) =>{($(read_value !($iter ,$t ) ) ,*) } ;($iter :expr ,[$t :tt ;$len :expr ] ) =>{(0 ..$len ) .map (|_ |read_value !($iter ,$t ) ) .collect ::<Vec <_ >>() } ;($iter :expr ,{$t :tt =>$f :expr } ) =>{$f (read_value !($iter ,$t ) ) } ;($iter :expr ,chars ) =>{read_value !($iter ,String ) .chars () .collect ::<Vec <char >>() } ;($iter :expr ,usize1 ) =>{read_value !($iter ,usize ) -1 } ;($iter :expr ,$t :ty ) =>{$iter .next () .unwrap () .parse ::<$t >() .unwrap () } ;}
#[macro_export]
macro_rules !input_inner {($iter :expr ) =>{} ;($iter :expr ,) =>{} ;($iter :expr ,mut $var :ident :$t :tt $($r :tt ) *) =>{let mut $var =read_value !($iter ,$t ) ;input_inner !{$iter $($r ) *} } ;($iter :expr ,mut $var :ident $($r :tt ) *) =>{input_inner !{$iter ,mut $var :usize $($r ) *} } ;($iter :expr ,$var :ident :$t :tt $($r :tt ) *) =>{let $var =read_value !($iter ,$t ) ;input_inner !{$iter $($r ) *} } ;($iter :expr ,$var :ident $($r :tt ) *) =>{input_inner !{$iter ,$var :usize $($r ) *} } ;}
#[macro_export]
macro_rules !input {(source =$s :expr ,$($r :tt ) *) =>{let mut iter =$s .split_whitespace () ;input_inner !{iter ,$($r ) *} } ;(iter =$iter :ident ,$($r :tt ) *) =>{let s ={use std ::io ::Read ;let mut s =String ::new () ;std ::io ::stdin () .read_to_string (&mut s ) .unwrap () ;s } ;let mut $iter =s .split_whitespace () ;input_inner !{$iter ,$($r ) *} } ;($($r :tt ) *) =>{let s ={use std ::io ::Read ;let mut s =String ::new () ;std ::io ::stdin () .read_to_string (&mut s ) .unwrap () ;s } ;let mut iter =s .split_whitespace () ;input_inner !{iter ,$($r ) *} } ;}
#[derive(Clone, Debug)]
pub struct PrimeTable {
    table: Vec<usize>,
}
impl PrimeTable {
    pub fn new(max_n: usize) -> Self {
        let mut table = vec![1; max_n + 1];
        table[0] = 0;
        table[1] = 0;
        for i in 2..(max_n as f32).sqrt() as usize + 1 {
            if table[i] == 1 {
                for j in ((i * i)..(max_n + 1)).step_by(i) {
                    if table[j] == 1 {
                        table[j] = i;
                    }
                }
            }
        }
        PrimeTable { table: table }
    }
    pub fn is_prime(&self, n: usize) -> bool {
        self.table[n] == 1
    }
    pub fn prime_factors(&self, n: usize) -> std::collections::HashMap<usize, usize> {
        let mut factors = std::collections::HashMap::new();
        let mut i = n;
        while self.table[i] != 1 {
            *factors.entry(self.table[i]).or_insert(0) += 1;
            i /= self.table[i];
        }
        *factors.entry(i).or_insert(0) += 1;
        factors
    }
}
fn main() {
    #[allow(unused_imports)]
    use std::io::Write as _;
    let __out = std::io::stdout();
    #[allow(unused_mut, unused_variables)]
    let mut __out = std::io::BufWriter::new(__out.lock());
    #[allow(unused_macros)]
    macro_rules !print {($($arg :tt ) *) =>(::std ::write !(__out ,$($arg ) *) .unwrap () ) }
    #[allow(unused_macros)]
    macro_rules !println {($($arg :tt ) *) =>(::std ::writeln !(__out ,$($arg ) *) .unwrap () ) }
    #[allow(unused_macros)]
    macro_rules! echo {
        ($iter :expr ) => {
            echo!($iter, "\n")
        };
        ($iter :expr ,$sep :expr ) => {
            let mut iter = $iter;
            if let Some(item) = iter.next() {
                print!("{}", item);
            }
            for item in iter {
                print!("{}{}", $sep, item);
            }
            println!();
        };
    }
    input!(n);
    let mut ans = 1usize;
    let mut v = vec![1; n + 1];
    let pt = PrimeTable::new(n + 1);
    for i in 2..=n {
        let mut j = i;
        let mut p = vec![];
        while pt.table[j] != 1 {
            if v[pt.table[j]] == 1 {
                p.push(pt.table[j]);
            }
            v[pt.table[j]] += 1;
            j /= pt.table[j];
        }
        if v[j] == 1 {
            p.push(j);
        }
        v[j] += 1;
        let mut x = 1;
        for i in p.into_iter() {
            x *= v[i];
            v[i] = 1;
        }
        ans += i * x;
    }
    println!("{}", ans);
}


Measured memory_bytes: 158348