using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace YukiCoder { class Program { static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); var pr = new List() { 0 }; var pa = Enumerable.Range(2, N - 1).ToList(); for (int k = 1; k * k < N; ) { k = pa[0]; pr.Add(k); pa.RemoveAll(x => x % k == 0); } pr.AddRange(pa); Console.WriteLine(pr.Sum()); Console.ReadLine(); } } }