using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static string[] SList(long n) => Enumerable.Repeat(0, (int)n).Select(_ => ReadLine()).ToArray(); public static void Main() { Solve(); } static void Solve() { var n = long.Parse(ReadLine()); if (n > 1_200_000) return; var ans = 0L; var mod = 998_244_353; for (var j = 1; j <= n; ++j) { var cnt = n - j + 1; var max = (cnt + j - 1) / j; var maxcnt = (cnt + j - 1) % j + 1; ans = (ans + max * (max + 1) / 2 % mod * maxcnt % mod + max * (max - 1) / 2 % mod * (j - maxcnt) % mod) % mod; } WriteLine(ans); } }