fn read() -> u32 { let mut s = String::new(); std::io::stdin().read_line(&mut s).unwrap(); s.trim().parse().unwrap() } // n を与えると [l, r], q を返す // 順序はようわからん // f(l, r, q): x \in [l, r] で floor(n / x) = q fn quot_range(n: u32, mut f: F) where F: FnMut(u32, u32, u32) { let mut pre = (0, 0); for d in 1.. { let q = n / d; if pre != (0, 0) { let (q, l, r) = (pre.0, q + 1, pre.1); f(l, r, q); } if q < d { break; } pre = (d, q); f(d, d, q); if q == d { break; } } } fn run() { let n = read(); const MOD: u64 = 1_000_000_007; let mut ans = 0; quot_range(n, |l, r, q| { let l = l as u64; let r = r as u64; let q = q as u64; let n = n as u64; ans += (r - l + 1) * (q - 1) * (n - 2) % MOD; ans += MOD - (r - l + 1) * (q - 1) * (q - 2) % MOD; }); quot_range(n, |l, r, q| { if q <= 2 { return; } let w = (r - l + 1) as u64; let mut s = 0; quot_range(q, |l, r, q| { if l > 1 { let l = l as u64; let r = r as u64; let q = q as u64; s += (r - l + 1) * (q - 1); } }); ans += MOD - s % MOD * w % MOD; }); ans %= MOD; println!("{}", ans); } fn main() { run(); }