import java.util.*; public class dice_product_3 { public static long divfm(long a, int p) { int b = p - 2; long result = 1; a = (a % p + p) % p; while (b != 0) { if ((b & 1) == 1) { result = (a * result) % p; } a = (a * a) % p; b >>= 1; } return result; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); HashMap dp = new HashMap<>(); Set s = new TreeSet<>(); dp.put(1L, 1L); s.add(1L); int mod = 998244353; long inverse = divfm(5, 998244353); while(!s.isEmpty()) { long x = s.iterator().next(); s.remove(x); if(x >= n) break; for(int i = 2; i <= 6; i++) { s.add(x * i); dp.putIfAbsent(x * i, 0L); dp.put(x * i, (dp.get(x * i) + (dp.get(x) * inverse) % mod) % mod); } } if(dp.containsKey(n)) { System.out.println(dp.get(n)); } else { System.out.println(0); } sc.close(); } }