Brave Seekers of Unicorns

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

You are a member of the Brave Seekers of Unicorns (BSU), the secret magical order. The BSU is fond of seeking unicorns. Recently, they have agreed to call an array a_1,a_2,,a_ka\_1, a\_2, \ldots, a\_k of kk integers a unicorn if it satisfies the following conditions:

  • the array is not empty (k>0k > 0);
  • there are no three consecutive elements with their bitwise XOR equal to zero (a_ia_i+1a_i+20a\_i \oplus a\_{i+1} \oplus a\_{i+2} \ne 0 for all 1ik21 \le i \le k - 2);
  • the array is strictly increasing (a_i<a_i+1a\_i < a\_{i+1} for all 1ik11 \le i \le k - 1);
  • the elements of the array are integers between 11 to nn, inclusively (1a_in1 \le a\_i \le n for all 1ik1 \le i \le k).

For example, if n=10n = 10, then the array \[1,4,5,9]\[1, 4, 5, 9] is not a unicorn because 145=01 \oplus 4 \oplus 5 = 0, but the array \[2,4,7,9]\[2, 4, 7, 9] is a unicorn.

The Grand Master of the BSU has commanded you to calculate the number of unicorns. Since the number can be pretty large, you must compute it modulo 998,244,353998\\,244\\,353.

입력

The only line contains an integer nn (1n1061 \le n \le 10^6).

출력

Print the number of unicorns modulo 998,244,353998\\,244\\,353.